[Bug 1577596] Re: ntpd not started when using ntpdate

ChristianEhrhardt 1577596 at bugs.launchpad.net
Wed Jul 12 06:25:24 UTC 2017


*** This bug is a duplicate of bug 1593907 ***
    https://bugs.launchpad.net/bugs/1593907

Hi Everybody,
I looked into this again as a friend asked me. And it turns out there is an update probably worth it.

Two things to mention:
1. the locking issue of /run/lock/ntpdate vs /var/lock/ntpdate (Thanks Paul for finding that).
   While I agree it is an issue by reading the code, I found that it is not that much of an issue 
   effectively. The reason is that the base directories are linked.
   # ll /var/lock
   lrwxrwxrwx 1 root root 9 Apr 25 09:51 /var/lock -> /run/lock/

2. The collision of the stop/starting of ntpd due to the ntpdate hook.
   That is a real issue and actually causing more than just your symptom here.
   That part of it will be addressed in bug 1593907 which is about to be SRUed soon I hope.

Now what does this imply for this bug here, I'd say there is quite some
hope that the issue resolves once the SRU of bug 1593907 is complete. I
couldn't yet reproduce so I can't verify yet.

But I want you involved and get the automatic updates of the SRU process so that you can check any effect on your issue when it is available.
What I'll do is to mark this bug as a duplicate to 1593907. Once that one is in proposed please update this bug over here (not on the one I it dup to).
If it fixes the issue great - and I hope/expect it does - great, if not we can un-dup this one again.

** This bug has been marked a duplicate of bug 1593907
   ntpdate startup routine prevents ntp service from launching up on Ubuntu 16.04 server on system boot; manually starting ntp service works: [FIX in DESCRIPTION], just need to apply it and release a new version

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to init-system-helpers in Ubuntu.
https://bugs.launchpad.net/bugs/1577596

Title:
  ntpd not started when using ntpdate

Status in init-system-helpers package in Ubuntu:
  Confirmed
Status in ntp package in Ubuntu:
  Won't Fix

Bug description:
  After updating from 14.04 to 16.04 on a number of my systems, ntpd no
  longer starts at boot on any of those systems.

  `systemctl status ntp` shows:
     ntp.service - LSB: Start NTP daemon
     Loaded: loaded (/etc/init.d/ntp; bad; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:systemd-sysv-generator(8)
  May 02 19:10:14 host systemd[1]: Stopped LSB: Start NTP daemon.
  May 02 19:10:17 host systemd[1]: Stopped LSB: Start NTP daemon.

  Manually starting it using `systemctl start ntp` works fine.  However,
  systemd does not seem to want to start it automatically at boot time.


  As best as I can tell based on trial and error, there is something
  special about the combination of the service being named "ntp.service"
  and the service depending on network.target.  However, I haven't been
  able to identify exactly what is causing this.

  If I copy the init script to any other name, everything works fine:
  cp /etc/init.d/ntp /etc/init.d/ntpd
  Edit /etc/init.d/ntpd and change "Provides: ntp" to "Provides: ntpd"
  systemctl enable ntpd
  # After a reboot, ntpd.service is started, but ntp.service is not.

  If I remove "$network" from the "# Required-Start: $network $remote_fs
  $syslog" line in /etc/init.d/ntp, then systemd starts it automatically
  ... But of course it is started before the network comes up, so it
  fails.

  If I replace /etc/init.d/ntp with a file containing only the following, systemd won't try to start it automatically at boot:
  #!/bin/sh
  ### BEGIN INIT INFO
  # Provides: ntp
  # Required-Start: $network
  # Required-Stop: $network
  # Default-Start: 2 3 4 5
  # Default-Stop: 1
  # Short-Description: Start NTP daemon
  ### END INIT INFO
  echo "script was run" >> /ntp.log

  If I rename that same dummy script to /etc/init.d/ntp2, it is started
  automatically at boot.

  However, grepping the systemd source code and my systemd config files for ntp doesn't seem to find anything that might cause this behavior:
  /etc/systemd# grep -iR ntp *
  timesyncd.conf:#NTP=
  timesyncd.conf:#FallbackNTP=ntp.ubuntu.com
  /lib/systemd# grep -R ntp *
  system/systemd-timesyncd.service.d/disable-with-time-daemon.conf:ConditionFileIsExecutable=!/usr/sbin/ntpd
  system/systemd-timesyncd.service.d/disable-with-time-daemon.conf:ConditionFileIsExecutable=!/usr/sbin/openntpd
  Binary file systemd-networkd matches
  Binary file systemd-timedated matches
  Binary file systemd-timesyncd matches

  What else can I do to debug this further?

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/init-system-helpers/+bug/1577596/+subscriptions



More information about the foundations-bugs mailing list