[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: systemd/dhcp v. ntpd



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?

Under bullseye, if the ntp package (which supplies the ntpd program) is
installed, then systemd-timesyncd is removed.  The two packages will not
coexist.

Under some older versions of Debian (I'm not sure when it changed exactly),
they can coexist, but the systemd-timesyncd service is configured not to
run if /usr/sbin/ntpd exists and is executable.

Either way, if ntp(d) is installed, systemd will not do anything regarding
time synchronization or NTP.

> 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 :(

This is too vague.  What are you actually seeing?

unicorn:~$ ps auxw | grep ntpd
ntp          758  0.0  0.0  74696  3896 ?        Ssl  Feb04   0:14 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 107:112
greg      290127  0.0  0.0   6244  2404 pts/0    S+   15:04   0:00 grep ntpd

The ntpd program (service) isn't started with an NTP server address as
an argument.  The configuration is all in files.

unicorn:~$ grep -e ^server -e ^pool /etc/ntp.conf 
pool 0.debian.pool.ntp.org iburst
pool 1.debian.pool.ntp.org iburst
pool 2.debian.pool.ntp.org iburst
pool 3.debian.pool.ntp.org iburst

Are you claiming that systemd has somehow modified your /etc/ntp.conf
file?  What change did it make?  What does your ntp.conf file look like
now, after the change?

> 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?

Why would that be the case?  Is there a file or directory on you system
that has the wrong ownership?

What errors were you getting in your logs?


Reply to: