ti 11.6.2024 klo 11.53 Martin-Éric Racine ([email protected]) kirjoitti:
>
> la 25. toukok. 2024 klo 13.49 Samuel Thibault ([email protected]) 
> kirjoitti:
>
> > Martin-Éric Racine, le sam. 25 mai 2024 12:39:20 +0300, a ecrit:
> > > la 25. toukok. 2024 klo 10.17 Martin-Éric Racine
> > > ([email protected]) kirjoitti:
> > > > I cannot help but notice that the Hurd port still depends on 'ntpdate'
> > > > to sync its clock upon bootup. The key problem is that Debian has
> > > > migrated to 'src:ntpsec' which made 'bin:ntpdate' a transitional
> > > > package. However, 'rdate' seemingly has been ported to Hurd. Assuming
> > > > that it is verified to work, it could be usefull to migrate the Hurd
> > > > port to it.
> > >
> > > As far as I can tell, on Hurd i386, using 'rdate' without any option
> > > does nothing. The command just sits there and wait.
> > >
> > > $ sudo rdate -v pool.ntp.org
> > >
> > > However, if I use the -n option for SNTP, it returns something:
> > >
> > > $ sudo rdate -n -v pool.ntp.org
> > > Sat May 25 12:35:42 EEST 2024
> > > rdate: adjust local clock by -0.005979 seconds
> >
> > According to the package description,
> >
> > “By default, rdate uses the RFC 868 TCP protocol.”
> >
> > so it apparently indeed needs to be told to use ntp, when targetting an
> > ntp server.
> >
> > > Unless I'm mistaken, this means that Hurd should be able to use a
> > > wrapper script similar to 'ntpdate-debian' to achieve the same result
> > > as the old reference 'ntpdate' Hurd has forked.
> >
> > Indeed.
> >
> > > It should be fairly trivial to implement and submit to the 'rdate'
> > > maintainer for inclusion, at which point Hurd's old NTP fork could be
> > > put to rest.
> >
> > Help welcome ;)
>
> I've looked into this, and I have found a simple fix:
>
> An /etc/network/if-up.d/ script is installed by ntpdate. It doesn't
> ship any init script.
>
> Therefore all we need is a similar if-up.d script that calls 'rdate -n
> pool.ntp.org' and we're good to go.
>
> If we really want to be fancy, we could add a
> /etc/dhcp/dhclient-exit-hooks.d/ script to append the ISP's preferred
> NTP server instead of the above default.

Thiago gave me the go-ahead to upload an NMU for rdate. See attached
debdiff. Would that work for us? Any obvious gotcha I missed?

Martin-Éric

PS: Thiago, there seems to be pending commits sitting in Salsa Git
that might be worth including. Should I include those too in the NMU
too, or would you rather merge these and the attached patch and
produce the release yourself?
diff -Nru rdate-1.11/debian/changelog rdate-1.11/debian/changelog
--- rdate-1.11/debian/changelog 2023-01-31 14:40:46.000000000 +0200
+++ rdate-1.11/debian/changelog 2026-02-05 11:47:05.000000000 +0200
@@ -1,3 +1,14 @@
+rdate (1:1.11-3.1) unstable; urgency=medium
+
+  * Non-maintainer upload, as per e-mail with Thiago Andrade on 2026-01-28.
+  * debian/control:
+    Add rdate-ntpdate package for DHCP exit script (Closes: #1072978).
+  * debian/rules:
+    Add support for LFS flags.
+  * Run wrap-and-sort.
+
+ -- Martin-Éric Racine <[email protected]>  Thu, 05 Feb 2026 11:47:05 
+0200
+
 rdate (1:1.11-3) unstable; urgency=medium
 
   [ Thiago Andrade Marques ]
diff -Nru rdate-1.11/debian/control rdate-1.11/debian/control
--- rdate-1.11/debian/control   2023-01-31 14:35:50.000000000 +0200
+++ rdate-1.11/debian/control   2026-02-05 11:38:56.000000000 +0200
@@ -11,9 +11,9 @@
 
 Package: rdate
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}
 Replaces: netstd
-Description: sets the system's date from a remote host with network time 
protocol
+Description: sets the system's date from a remote host with Network Time 
Protocol
  OpenRdate or openrdate or rdate displays and sets the local date and time from
  the host name or address given as the argument. The time source may be an RFC
  868 TCP protocol server, which is usually implemented as a built-in service of
@@ -25,6 +25,15 @@
 Package: rdate-udeb
 Section: debian-installer
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}
 Package-Type: udeb
 Description: sets the system's date from a remote host
+
+Package: rdate-ntpdate
+Architecture: all
+Depends: rdate, ${misc:Depends}, ${shlibs:Depends}
+Breaks: ntpdate (<< 1:4.2.8p15+dfsg-2~)
+Replaces: ntpdate (<< 1:4.2.8p15+dfsg-2~)
+Description: DHCP exit script for rdate
+ This script calls rdate with the -n option to synchronize the local clock
+ with a remote NTP server upon successful DHCP configuration.
diff -Nru rdate-1.11/debian/copyright rdate-1.11/debian/copyright
--- rdate-1.11/debian/copyright 2023-01-31 14:37:47.000000000 +0200
+++ rdate-1.11/debian/copyright 2026-02-05 11:35:24.000000000 +0200
@@ -45,6 +45,7 @@
            2009      Cyril Brulebois
            2019      Joao Eriberto Mota Filho <[email protected]>
            2019-2023 Thiago Andrade Marques <[email protected]>
+           2026      Martin-Éric Racine <[email protected]>
 License: BSD-3-Clause
 
 License: BSD-4-Clause
diff -Nru rdate-1.11/debian/rdate-ntpdate.default 
rdate-1.11/debian/rdate-ntpdate.default
--- rdate-1.11/debian/rdate-ntpdate.default     1970-01-01 02:00:00.000000000 
+0200
+++ rdate-1.11/debian/rdate-ntpdate.default     2026-02-05 11:31:29.000000000 
+0200
@@ -0,0 +1,7 @@
+# These settings are used by the package rdate-ntpdate.
+
+# List the NTP server to use (rdate only accepts one).
+NTPSERVER=0.debian.pool.ntp.org
+
+# Additional options to pass to rdate.
+RDATEOPTIONS=""
diff -Nru rdate-1.11/debian/rdate-ntpdate.dhcp 
rdate-1.11/debian/rdate-ntpdate.dhcp
--- rdate-1.11/debian/rdate-ntpdate.dhcp        1970-01-01 02:00:00.000000000 
+0200
+++ rdate-1.11/debian/rdate-ntpdate.dhcp        2026-02-05 11:13:10.000000000 
+0200
@@ -0,0 +1,7 @@
+. /etc/default/rdate-ntpdate
+case $reason in
+BOUND | RENEW | REBIND | REBOOT)
+       rdate -n $RDATEOPTIONS $NTPSERVER
+       ;;
+EXPIRE | FAIL | RELEASE | STOP) ;;
+esac
diff -Nru rdate-1.11/debian/rules rdate-1.11/debian/rules
--- rdate-1.11/debian/rules     2023-01-31 14:15:38.000000000 +0200
+++ rdate-1.11/debian/rules     2026-02-05 11:33:21.000000000 +0200
@@ -5,9 +5,19 @@
 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+# Append flags for Long File Support (LFS)
+# LFS_CPPFLAGS does not exist
+export DEB_CFLAGS_MAINT_APPEND  +=$(shell getconf LFS_CFLAGS) 
$(HARDENING_CFLAGS)
+export DEB_LDFLAGS_MAINT_APPEND +=$(shell getconf LFS_LDFLAGS) 
$(HARDENING_LDFLAGS)
 
 %:
        dh $@
 
 override_dh_auto_configure:
        dh_auto_configure -- --host=$(DEB_HOST_GNU_TYPE) 
--build=$(DEB_BUILD_GNU_TYPE)
+
+override_dh_install:
+       install -D -m 0644 debian/rdate-ntpdate.dhcp \
+                
debian/rdate-ntpdate/etc/dhcp/dhclient-exit-hooks.d/rdate-ntpdate
+       dh_link
+       dh_install

Reply via email to