after network...

Richard Laager rlaager at wiktel.com
Mon Nov 29 04:39:40 UTC 2021


On 11/27/21 8:45 AM, Udo van den Heuvel wrote:
> On 26-11-2021 06:52, Hal Murray wrote:
>>> ntpd does not start, reliably.
>>
>> What goes wrong?  Is there an error message?
> 
> What I can find in journalctl -b:
> 
> systemd[1]: Dependency failed for Wait for ntpd to synchronize system 
> clock.

That is a failure of ntp-wait.service, not ntpd.service.

ntp-wait.service only serves a purpose (and only needs to be enabled) if 
something is going to depend on it. For example, on my email servers, I 
use a drop-in to configure dovecot.service to Requires= & After= 
ntp-wait.service. This way, dovecot does not start until ntpd has set 
the clock. This way, time never moves backwards, which Dovecot really hates.

If you're not actually using ntp-wait.service, just disable it:

     sudo systemctl disable ntp-wait.service

> This is before the network scripts I still use (no network-manager...).
> 
> network[2433]: WARN      : [network] You are using 'network' service 
> provided by 'network-scripts', which are now deprecated.
> network[2433]: WARN      : [network] 'network-scripts' will be removed 
> from distribution in near future.
> network[2433]: WARN      : [network] It is advised to switch to 
> 'NetworkManager' instead for network management.
> 
> Thus I think it fails due to lack of network connectivity.

If the above didn't answer your question, I'd check the following, 
probably in this order:

1) Are you sure that the issue is that ntpd is not dealing well with the 
network being up?

2) If so, can that be addressed with ntpd in some (trivial) fashion?

3) If not, try adding a drop-in (e.g. 
/etc/systemd/system/ntpd.service.d/network.conf) that adds Wants= & 
After=network-online.target. But note that your network subsystem must 
actually support the network-online.target.

See also:
https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/

-- 
Richard


More information about the devel mailing list