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

Jongkyu Seok <[email protected]>
Newsgroups gmane.comp.time.chrony.user
Message-ID <CANCaXPGNRpdfgXZrDSxVuJ_QEFpppDovpgof_+iUbKfhr-Qjyg@mail.gmail.com>
>
> Does it work if you have the link only in the configured.d and off.d
> directories? It would be nice to at least fix that comment in the
> script if it's wrong.


It works.
If the configured state always appears later than the routable state, then
this is probably the obvious solution.
I don't know if this is a possible situation, but if the
AdministrativeState becomes configured first when the OperationalState is
not routable, I think having the link file only in the configured and off
directories will cause problems.

FYI, I've attached the logs for a couple of cases.
Each log contains all systemd-networkd events on the interface that occur
during boot. (including dormant.d, no-carrier.d... etc.)
To the event that the 20-chrony script is called, I appended the source
state immediately after the chronyc onoffline command was executed.

*[Log 1]*
    - Log of servers experiencing 'sources offline' issue.
    - Link files are only in the configured.d and off.d directories.

IFACE : eth0 / STATE : configuring / AdministrativeState : configuring /
OperationalState : no-carrier

IFACE : eth0 / STATE : no-carrier / AdministrativeState : configuring /
OperationalState : no-carrier

IFACE : eth0 / STATE : carrier / AdministrativeState : configuring /
OperationalState : carrier

IFACE : eth0 / STATE : routable / AdministrativeState : configuring /
OperationalState : routable

[20-chrony is called] IFACE : eth0 / STATE : configured /
AdministrativeState : configured / OperationalState : routable

    ↳ [chronyc activity result at the moment]

200 OK

1 sources online

0 sources offline

0 sources doing burst (return to online)

0 sources doing burst (return to offline)

2 sources with unknown address

IFACE : eth0 / STATE : no-carrier / AdministrativeState : configured /
OperationalState : no-carrier

IFACE : eth0 / STATE : carrier / AdministrativeState : configured /
OperationalState : carrier

IFACE : eth0 / STATE : configuring / AdministrativeState : configuring /
OperationalState : carrier

IFACE : eth0 / STATE : routable / AdministrativeState : configuring /
OperationalState : routable

[20-chrony is called] IFACE : eth0 / STATE : configured /
AdministrativeState : configured / OperationalState : routable

    ↳ [chronyc activity result at the moment]

200 OK

3 sources online

0 sources offline

0 sources doing burst (return to online)

0 sources doing burst (return to offline)

0 sources with unknown address



*[Log 2]*
    - Log of servers experiencing 'sources offline' issue.
    - Link files are only in the routable.d and off.d directories.

IFACE : eth0 / STATE : configuring / AdministrativeState : configuring /
OperationalState : no-carrier

IFACE : eth0 / STATE : no-carrier / AdministrativeState : configuring /
OperationalState : no-carrier

IFACE : eth0 / STATE : carrier / AdministrativeState : configuring /
OperationalState : carrier

[20-chrony is called] IFACE : eth0 / STATE : routable / AdministrativeState
: configuring / OperationalState : routable

    ↳ [chronyc activity result at the moment]

200 OK

0 sources online

0 sources offline

0 sources doing burst (return to online)

0 sources doing burst (return to offline)

3 sources with unknown address

IFACE : eth0 / STATE : configured / AdministrativeState : configured /
OperationalState : routable

IFACE : eth0 / STATE : no-carrier / AdministrativeState : configured /
OperationalState : no-carrier

IFACE : eth0 / STATE : carrier / AdministrativeState : configured /
OperationalState : carrier

IFACE : eth0 / STATE : configuring / AdministrativeState : configuring /
OperationalState : carrier

[20-chrony is called] IFACE : eth0 / STATE : routable / AdministrativeState
: configuring / OperationalState : routable

    ↳ [chronyc activity result at the moment]

200 OK

0 sources online

3 sources offline

0 sources doing burst (return to online)

0 sources doing burst (return to offline)

0 sources with unknown address

IFACE : eth0 / STATE : configured / AdministrativeState : configured /
OperationalState : routable


*[Log 3]*
    - Log of servers not experiencing 'sources offline' issue.
    - Link files are only in the configured.d and off.d directories.

[20-chrony is called] IFACE : eth0 / STATE : configured /
AdministrativeState : configured / OperationalState : routable

    ↳ [chronyc activity result at the moment]

200 OK

3 sources online

0 sources offline

0 sources doing burst (return to online)

0 sources doing burst (return to offline)

0 sources with unknown address

IFACE : eth0 / STATE : routable / AdministrativeState : configured /
OperationalState : routable


*[Log 4]*
    - Log of servers not experiencing 'sources offline' issue.
    - Link files are only in the routable.d and off.d directories.

IFACE : eth0 / STATE : configured / AdministrativeState : configured /
OperationalState : routable

[20-chrony is called] IFACE : eth0 / STATE : routable / AdministrativeState
: configured / OperationalState : routable

    ↳ [chronyc activity result at the moment]

200 OK

3 sources online

0 sources offline

0 sources doing burst (return to online)

0 sources doing burst (return to offline)

0 sources with unknown address




Best Regards


2023년 6월 14일 (수) 오후 10:11, Miroslav Lichvar <[email protected]>님이 작성:

> On Wed, Jun 14, 2023 at 07:26:11PM +0900, Jongkyu Seok wrote:
> > Based on your answer, it sounds like simply creating a link under the
> > configured.d directory without any script modifications would solve the
> > problem.
>
> Does it work if you have the link only in the configured.d and off.d
> directories? It would be nice to at least fix that comment in the
> script if it's wrong.
>
> I had a quick look at the systemd-network code, but wasn't able to
> figure out how what is the state when applications can expect to be
> able to make network connections.
>
> --
> 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.