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

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]


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@xxxxxxxxxxxxxxxxxxxx 
with "unsubscribe" in the subject.
For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/