Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #245143

Re: systemd/dhcp v. ntpd

From Reco <recoverym4n@enotuniq.net>
Newsgroups linux.debian.user
Subject Re: systemd/dhcp v. ntpd
Date 2022-02-09 16:10 +0100
Message-ID <DOWLv-E6f-1@gated-at.bofh.it> (permalink)
References <DOEYh-tbR-3@gated-at.bofh.it> <DOFhD-tku-3@gated-at.bofh.it> <DOW8N-DDu-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


	Hi.

On Wed, Feb 09, 2022 at 09:05:51AM -0500, Lee wrote:
> On 2/8/22, Greg Wooledge <greg@wooledge.org> wrote:
> > On Tue, Feb 08, 2022 at 02:43:02PM -0500, Lee wrote:
> >> How to tell systemd to leave the ntpd config alone?
> >
> > What makes you think the two are connected in any way?
> 
> $ grep "Network Time Service" syslog
> Feb  6 12:06:48 spot systemd[1]: Stopping Network Time Service...
> Feb  6 12:06:48 spot systemd[1]: Stopped Network Time Service.
> Feb  6 12:06:48 spot systemd[1]: Starting Network Time Service...
> Feb  6 12:06:48 spot systemd[1]: Started Network Time Service.
> Feb  6 12:09:25 spot systemd[1]: Stopping Network Time Service...
> Feb  6 12:09:25 spot systemd[1]: Stopped Network Time Service.
> Feb  6 12:09:25 spot systemd[1]: Starting Network Time Service...
> Feb  6 12:09:25 spot systemd[1]: Started Network Time Service.
> Feb  6 12:22:53 spot systemd[1]: Stopping Network Time Service...
> Feb  6 12:22:53 spot systemd[1]: Stopped Network Time Service.
> Feb  6 12:22:53 spot systemd[1]: Starting Network Time Service...
> Feb  6 12:22:53 spot systemd[1]: Started Network Time Service.
>   ... etc
> 
> every time I connect or disconnect from a wifi network.

Or it could mean that dhclient hook merely asks systemd to restart ntpd
service. See /etc/dhcp/dhclient-exit-hooks.d/ntp.


> My first thought was telling the machine to ignore the NTP server
> address handed out via DHCP.  Maybe there's a way to do that, but I
> couldn't figure out how :(

supercede ntp-servers "..." in dhclient.conf should do it for you.

The option was helpfully provided by dhclient.conf(5).


> >> I tried changing /etc/dhcp/dhclient.conf to request just
> >>   request   subnet-mask, broadcast-address, routers,
> >>             interface-mtu,
> >>             rfc3442-classless-static-routes ;
> >>
> >> and systemd still restarted ntpd with only the dhcp supplied ntp
> >> server address ... which is this machine, so all the configured ntp
> >> servers went away :(

And that merely stopped dhclient from asking DHCP server to provide
"ntp-server" option. What it cannot stop is DHCP server providing
"ntp-server" option anyway.

ISC dhclient simply lacks the option to ignore certain options in DHCP
reply. It can supercede them though.


> >> I then tried telling network manager to just get an ip address &
> >> subnet mask from dhcp.  And still systemd fucked up the ntpd config
> >>
> >> What finally worked was editing /usr/lib/ntp/ntp-systemd-wrapper to
> >> remove ' NTPD_OPTS="$NTPD_OPTS -u $UGID" '
> >
> > Huh?  You're saying that removing the "-u $UGID" option made it "work"?
> > And that it "didn't work" with -u being passed?

Changing the contents of /etc/dhcp/dhclient-exit-hooks.d/ntp would make
it more friendly for the purpose of the future updates.

Reco

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

systemd/dhcp v. ntpd Lee <ler762@gmail.com> - 2022-02-08 21:10 +0100
  Re: systemd/dhcp v. ntpd Greg Wooledge <greg@wooledge.org> - 2022-02-08 21:30 +0100
    Re: systemd/dhcp v. ntpd Lee <ler762@gmail.com> - 2022-02-09 15:30 +0100
      Re: systemd/dhcp v. ntpd Reco <recoverym4n@enotuniq.net> - 2022-02-09 16:10 +0100
        Re: systemd/dhcp v. ntpd Greg Wooledge <greg@wooledge.org> - 2022-02-09 16:50 +0100
          Re: systemd/dhcp v. ntpd Lee <ler762@gmail.com> - 2022-02-09 17:20 +0100
            Re: systemd/dhcp v. ntpd Reco <recoverym4n@enotuniq.net> - 2022-02-09 17:50 +0100
            Re: systemd/dhcp v. ntpd Greg Wooledge <greg@wooledge.org> - 2022-02-09 18:10 +0100
            Re: systemd/dhcp v. ntpd Tim Woodall <debianuser@woodall.me.uk> - 2022-02-12 07:00 +0100
              Re: systemd/dhcp v. ntpd Lee <ler762@gmail.com> - 2022-02-16 18:40 +0100
                Re: systemd/dhcp v. ntpd Tim Woodall <debianuser@woodall.me.uk> - 2022-02-17 16:40 +0100
                Re: systemd/dhcp v. ntpd Lee <ler762@gmail.com> - 2022-02-19 15:30 +0100
        Re: systemd/dhcp v. ntpd Lee <ler762@gmail.com> - 2022-02-09 17:10 +0100
          Re: systemd/dhcp v. ntpd Reco <recoverym4n@enotuniq.net> - 2022-02-09 17:50 +0100
      Re: systemd/dhcp v. ntpd Charles Curley <charlescurley@charlescurley.com> - 2022-02-09 16:10 +0100

csiph-web