Re: NetworkManager dispatcher script(20-chrony) not working on systemd-networkd

Miroslav Lichvar <[email protected]>
Newsgroups gmane.comp.time.chrony.user
Message-ID <ZIl+ONFo9WFSJrG0@localhost>
On Wed, Jun 14, 2023 at 04:44:50PM +0900, Jongkyu Seok wrote:
> Because networkd-dispatcher uses specific environment variables to pass
> interface state, nothing exists in the shell argument of dispatcher script.
> 
> Because of this, the '[ $# -ge 2]' condition in the existing
> NetworkManager-based script (20-chrony) was always FALSE, causing the
> 'chronyc onoffline' command to be executed regardless of the type of
> interface event.

That condition is there for the case when running as a NetworkManager
dispatcher script. As a networkd-dispatcher script it is expected to
always make the chronyc command when the script is executed, i.e. on
the routable and off events if linked in the routable.d and off.d
directories.

> And crucially, the script did not exist in the
> /usr/lib/networkd-dispatcher/configured.d/ directory, so the last time
> 'chronyc onoffline' was run when the interface was in the configuring
> state, the source was taken offline.

I don't follow. Doesn't the routable state follow configured? Why
would it need to be called twice?

Do you have an example sequence of the events?

> # Note: for networkd-dispatcher routable.d ~= on and off.d ~= off
> 
> [ "$STATE" != "routable" ] && [ "$AdministrativeState" != "configured" ] &&
> exit 0

Isn't this missing the "off" state?

-- 
Miroslav Lichvar


-- 
To unsubscribe email chrony-users-request-kWFZVVI9zxvPqho9SqqRMmD2FQJk+8+b@public.gmane.org 
with "unsubscribe" in the subject.
For help email chrony-users-request-kWFZVVI9zxvPqho9SqqRMmD2FQJk+8+b@public.gmane.org 
with "help" in the subject.
Trouble?  Email [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.