service ntp restart fails with error: unable to bind to wildcard address
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ntp (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Package: ntp
Version: 1:4.2.8p4+
Restarting the ntp daemon ntpd after a change in the configuration file /etc/ntp.conf via the shell command
% sudo service ntp restart
fails in a small fraction of cases (about 2-3%), logging the error:
unable to bind to wildcard address :: - another process may be running - EXITING
and leaving the system without a running ntpd process.
Expected behaviour: ntpd process running with new configuration
Actual behaviour: no ntpd process running
Additional information:
Syslog shows systemd launching the "start" action before the old daemon has exited.
Consequently, the new ntpd process races the old one for the UDP socket to listen on.
Example log excerpt:
May 25 06:31:12 capetown systemd[1]: Stopping LSB: Start NTP daemon...
May 25 06:31:12 capetown ntp[28437]: * Stopping NTP server ntpd
May 25 06:31:12 capetown ntp[28437]: ...done.
May 25 06:31:12 capetown systemd[1]: Stopped LSB: Start NTP daemon.
May 25 06:31:12 capetown systemd[1]: Starting LSB: Start NTP daemon...
May 25 06:31:12 capetown ntp[28449]: * Starting NTP server ntpd
May 25 06:31:12 capetown ntpd[28457]: ntpd 4.2.8p4@1.3265-o Tue Jan 7 15:08:23 UTC 2020 (1): Starting
May 25 06:31:12 capetown ntpd[28457]: Command line: /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 113:119
May 25 06:31:12 capetown ntp[28449]: ...done.
May 25 06:31:12 capetown systemd[1]: Started LSB: Start NTP daemon.
May 25 06:31:12 capetown ntpd[28460]: proto: precision = 0.105 usec (-23)
May 25 06:31:12 capetown ntpd[2749]: 41.76.128.222 local addr 192.168.0.42 -> <null>
May 25 06:31:12 capetown ntpd[28460]: MS-SNTP signd operations currently block ntpd degrading service to all clients.
May 25 06:31:12 capetown ntpd[28460]: restrict 0.0.0.0: KOD does nothing without LIMITED.
May 25 06:31:12 capetown ntpd[28460]: restrict ::: KOD does nothing without LIMITED.
May 25 06:31:12 capetown ntpd[28460]: unable to bind to wildcard address :: - another process may be running - EXITING
Running the "service ntp restart" command a second time successfully starts the ntpd daemon again.