12

On my Ubuntu 13.04 (using AWS). When I start a new machine or when I reboot my machine ntp does not start and I see the following in the syslog:

Jan 10 02:56:49 ntpd: unable to bind to wildcard address 0.0.0.0 - another process may be running - EXITING

I also notice that before this ntpdate was used to adjust time

Jan 10 02:45:20 ntpdate[960]: adjust time server offset -0.000259 sec

I am not sure if this is a race condition or me missing something here, I would appreciate if anyone can help me out here.

Thanks

6

This is because the ntpdate is running when you try to start the server. I haven't found reasons why to leave it installed so you could remove it if you are using ntp daemon:

sudo apt-get remove ntpdate
6

I've seen this on Debian Jessie. The cause appears to be a race between /etc/init.d/ntp and /etc/network/if-up.d/ntpdate, both of which appear to contain logic to lock each other out that doesn't actually work.

I like having the ntpdate command available even though I rarely use it, so rather than uninstall ntpdate altogether I've just inserted

exit 0

as the second line of /etc/network/if-up.d/ntpdate, which makes it do nothing. My ntp daemon now starts successfully at boot time.

  • This worked for me and this is a persistent change, but it might confuse the upgrade-wizard/process, when the system is upgraded to the next release. – knb Mar 14 '17 at 11:31
  • The "logic... that doesn't actually work" may be because it depends on having package lockfile-progs installed. Without that, the relevant blocks are silently skipped and the locking will not work. – Peter Hansen Jul 14 '17 at 15:07
4

Had a similar problem on Debian 5,

a simple restart of ntp solved it for me

/etc/init.d/ntp stop
/etc/init.d/ntp start

just in case other have same problem

NTPD was recently installed, it seems that a restart after install is needed, I noticed this on Debian 6 also.

  • 1
    This worked for me and solved the immediate issue. – jewettg Feb 24 '17 at 20:44
3

This was fixed in 2008 by adding locking, but if you disabled installing Recommends or uninstalled lockfile-progs then you will still have this problem (note that you should expect problems if you disabled installing Recommends).

  • AFAICT, in Jessie (8.8) it doesn't Recommend lockfile-progs :(. In Stretch (9.0), it is fixed again by calling the flock command instead. Thanks for the pointer. – sourcejedi Jun 20 '17 at 14:50
  • @sourcejedi packages.debian.org/jessie/ntpdate – wRAR Jun 21 '17 at 15:37
  • Heh, I had an assumption they would put the Recommends on both packages. Thanks again :). – sourcejedi Jun 21 '17 at 15:45
  • @sourcejedi ntpd doesn't need to lock against itself – wRAR Jun 22 '17 at 16:47
  • I have 16.04 and still see this problem after a logrotate. lockfile-progs is installed and it does not happen every time. Is ntpdate run once in a while and blocking ntpd at such times? – Alexis Wilke Aug 5 '18 at 23:31

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.