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


Groups > linux.debian.user > #245157

Re: systemd/dhcp v. ntpd

From Reco <recoverym4n@enotuniq.net>
Newsgroups linux.debian.user
Subject Re: systemd/dhcp v. ntpd
Date 2022-02-09 17:50 +0100
Message-ID <DOYkh-ESt-3@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> <DOWLv-E6f-1@gated-at.bofh.it> <DOXHz-EG6-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Feb 09, 2022 at 10:49:34AM -0500, Lee wrote:
> >> 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 not giving it a value - ie
> supersede ntp-servers ;
> 
> didn't work.  Apparently one _has_ to give it a value.

Yup. But you know which NTP servers you want this host to use, do you?


> >> >> 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.
> 
> The way I read the man page, supercede requires a value.

One can say that too.


> I can't just say ignore what the DHCP server gives me, I have to say
> use <this> instead of what the DHCP server gives me ... and there is
> no <this> value, it's several pool & server lines that I don't want
> replaced.

Changing DHCP client is an option too.


> >> >> 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.
> 
> Changing it or moving it to another, clearly not supposed to be
> invoked, directory?

Removing this hook should be sufficient. Even better - add "exit 0" to
the beginning.

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