Your message dated Fri, 23 Aug 2019 23:30:05 +0200
with message-id <[email protected]>
and subject line Re: Bug#861769: systemd: systemd-timesyncd does not use NTP 
server set by DHCP when NetworkManager is installed
has caused the Debian Bug report #861769,
regarding systemd: systemd-timesyncd does not use NTP server set by DHCP when 
NetworkManager is installed
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
861769: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=861769
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: systemd
Version: 232-22
Severity: normal

Dear Maintainers,

When NetworkManager is running /etc/dhcp/dhclient-exit-hooks.d/timesyncd and
other hooks in the directory are not triggered. See #537358 for a very
old report
involving other packages with DHCP hooks.

The widely adopted solution seems to be adding per-package scripts to
/etc/NetworkManager/dispatcher.d and the attached patch does that for systemd.

Cheers,
Balint

PS: The issue has been reported on Launchpad originally:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1685484

-- 
Balint Reczey
Debian & Ubuntu Developer
From 88d3488152bae8bbe4510fdbd9106b4270af5928 Mon Sep 17 00:00:00 2001
From: Balint Reczey <[email protected]>
Date: Wed, 3 May 2017 17:44:05 +0200
Subject: [PATCH] Set timesyncd's NTP server from DHCP even with NetworkManager

LP: #1685484
---
 debian/extra/dhclient-exit-hooks.d/timesyncd |  2 +-
 debian/extra/dispatcher.d/timesyncd          | 12 ++++++++++++
 debian/systemd.install                       |  1 +
 3 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100755 debian/extra/dispatcher.d/timesyncd

diff --git a/debian/extra/dhclient-exit-hooks.d/timesyncd b/debian/extra/dhclient-exit-hooks.d/timesyncd
index 3cde992..d567dd0 100644
--- a/debian/extra/dhclient-exit-hooks.d/timesyncd
+++ b/debian/extra/dhclient-exit-hooks.d/timesyncd
@@ -12,7 +12,7 @@ timesyncd_servers_setup_add() {
                 return
         fi
 
-        if [ -e $TIMESYNCD_CONF ] && [ "$new_ntp_servers" = "$old_ntp_servers" ]; then
+        if [ -e $TIMESYNCD_CONF ] && grep -q -F "NTP=$new_ntp_servers" $TIMESYNCD_CONF; then
                 return
         fi
 
diff --git a/debian/extra/dispatcher.d/timesyncd b/debian/extra/dispatcher.d/timesyncd
new file mode 100755
index 0000000..cc1f3bc
--- /dev/null
+++ b/debian/extra/dispatcher.d/timesyncd
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Call timesyncd DHCP hook on NetworkManager interface events
+
+if [ "$2" = "up" -a -n "${DHCP4_NTP_SERVERS:-}" ]; then
+    env reason="BOUND" \
+        new_ntp_servers="${DHCP4_NTP_SERVERS}" \
+        sh /etc/dhcp/dhclient-exit-hooks.d/timesyncd
+elif [ "$2" = "down" ]; then
+    env reason="STOP" \
+        sh /etc/dhcp/dhclient-exit-hooks.d/timesyncd
+fi
diff --git a/debian/systemd.install b/debian/systemd.install
index b3e0594..905600c 100644
--- a/debian/systemd.install
+++ b/debian/systemd.install
@@ -65,5 +65,6 @@ var/lib
 ../../extra/systemd-sysv-install lib/systemd/
 ../../extra/units/* lib/systemd/system/
 ../../extra/dhclient-exit-hooks.d/ etc/dhcp/
+../../extra/dispatcher.d/ etc/NetworkManager/
 ../../extra/kernel-install.d/* usr/lib/kernel/install.d
 ../../extra/pam.d etc/
-- 
2.7.4


--- End Message ---
--- Begin Message ---
On Thu, 4 May 2017 00:19:17 +0200 Balint Reczey
<[email protected]> wrote:
> Hi Michael,
> 
> On Wed, May 3, 2017 at 9:59 PM, Michael Biebl <[email protected]> wrote:
> > Hi Balint
> >
> > Am 03.05.2017 um 21:42 schrieb Balint Reczey:
> >> Package: systemd
> >> Version: 232-22
> >> Severity: normal
> >>
> >> Dear Maintainers,
> >>
> >> When NetworkManager is running /etc/dhcp/dhclient-exit-hooks.d/timesyncd 
> >> and
> >> other hooks in the directory are not triggered. See #537358 for a very
> >> old report
> >> involving other packages with DHCP hooks.
> >>
> >> The widely adopted solution seems to be adding per-package scripts to
> >> /etc/NetworkManager/dispatcher.d and the attached patch does that for 
> >> systemd.
> >>
> >
> > Aside some technical issues with the patch, I have to say I would prefer
> > a different approach, see
> > https://bugzilla.gnome.org/show_bug.cgi?id=746911
> 
> Yes, NM talking natively to systemd-timesyncd would be nice, indeed.

I think we should go this route and it's still early in the bullseye
release cycle. I think you should poke NM upstream about this.

Since I don't plan to add a temporary workaround to systemd, I'm closing
this bug report.

Regards,
Michael


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---

Reply via email to