| Re: [chrony-users] Re: NetworkManager dispatcher script(20-chrony) not working on systemd-networkd |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-users Archives
]
- To: Cooper <aconstantk@xxxxxxxxx>
- Subject: Re: [chrony-users] Re: NetworkManager dispatcher script(20-chrony) not working on systemd-networkd
- From: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
- Date: Mon, 3 Aug 2026 17:08:37 +0200
- Cc: chrony-users@xxxxxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1785769724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6sF6malS9G2j4ZJNNINcatsVdgV30GTVnrq+D1lSEP0=; b=UAMTveL6dLYXEERHYRE7xxx8FVK95P2zHwtVe1mQc3dY3v+jPFYA7Ul+a7iPle4n7HxAH7 rBNk0t3XZatV8vG8HeAk/fDWbEWihkDmMadIh2VZ7RlffFPXooTFvUKcXP+UhNEG10LJ7U CWC9P2iYjHMWRIV+lfWed+5ErxjeiXY=
On Sat, Jul 25, 2026 at 03:47:22PM +1000, Cooper wrote:
> Reopening an old thread from 2023:
> https://www.mail-archive.com/chrony-users@xxxxxxxxxxxxxxxxxxxx/msg03268.html
>
> chrony: NTP sources left permanently offline after transient network
> loss (networkd-dispatcher hook runs before the interface is usable; no
> configured.d symlink)
Thanks for the details logs and analysis (with help of an agent?).
Can you please try the attached script and see if it works as expected
for you? It matches both the operational and admin states to avoid the
race condition and also adds the no-carrier state. Maybe it should
also handle the failed state?
--
Miroslav Lichvar
#!/bin/sh
# This is a networkd-dispatcher script for chronyd to set its NTP sources
# online or offline when a network interface is configured or removed. It
# should be installed in the off.d, no-carrier.d, routable.d, and configured.d
# directories.
export LC_ALL=C
chronyc=/usr/bin/chronyc
# Consider only selected states
case "$OperationalState:$AdministrativeState" in
routable:configured)
;;
no-carrier:*|off:*)
;;
*:*)
exit 0;;
esac
$chronyc onoffline > /dev/null 2>&1
exit 0