<div dir="ltr"><div><div>Package: ntp</div><div>Version: 1:4.2.8p10+dfsg-5</div></div><div><br></div>Hi,<br>this is a follow on to bug 806556<br>Back then you fixed it for sysv-init and I can confirm it worked great.<br>But since recent versions the sysv script is no more used as there is a native systemd service.<br>I carried forward your change in bug 806556 to the systemd wrapper and it works just fine - again locking the start of the service against potentially racing ntpdate ifup hook executions.<br><br>If you agree, the following change should fix the issue:<br><br>diff --git a/debian/ntp-systemd-wrapper b/debian/ntp-systemd-wrapper<br>index 8d5d1f2..fead246 100755<br>--- a/debian/ntp-systemd-wrapper<br>+++ b/debian/ntp-systemd-wrapper<br>@@ -2,6 +2,7 @@<br> <br>DAEMON=/usr/sbin/ntpd<br>PIDFILE=/var/run/ntpd.pid<br>+LOCKFILE=/run/lock/ntpdate<br> <br>if [ -r /etc/default/ntp ]; then<br>        . /etc/default/ntp<br>@@ -17,5 +18,13 @@ if test "$(uname -s)" = "Linux"; then<br>        NTPD_OPTS="$NTPD_OPTS -u $UGID"<br>fi<br> <br>-exec $DAEMON -p $PIDFILE $NTPD_OPTS<br>+# Protect the service startup against concurrent ntpdate ifup hooks<br>+(<br>+    if flock -w 180 9; then<br>+        exec $DAEMON -p $PIDFILE $NTPD_OPTS<br>+    else<br>+        echo "Timeout waiting for $LOCKFILE"<br>+        exit 1<br>+    fi<br>+) 9>$LOCKFILE<div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(136,136,136);font-size:12.8px">Christian Ehrhardt</span><div style="color:rgb(136,136,136);font-size:12.8px">Software Engineer, Ubuntu Server</div><div style="color:rgb(136,136,136);font-size:12.8px">Canonical Ltd</div></div></div></div></div>
</div>