245.4-2ubuntu1 throws stderr messages on timesyncd restart in its dhcp hook

Bug #1873031 reported by Christian Ehrhardt  on 2020-04-15
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
chrony (Ubuntu)
High
Unassigned
systemd (Ubuntu)
Medium
Balint Reczey

Bug Description

systemd has broken this by the split of timesyncd.

On a system that installed chrony (or other NTP servers) you'll have:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=================-==============-============-===============================================================
ii chrony 3.5-6ubuntu3 amd64 Versatile implementation of the Network Time Protocol
rc systemd-timesyncd 245.4-4ubuntu1 amd64 minimalistic service to synchronize local time with NTP servers

That left this behind:
  /etc/dhcp/dhclient-exit-hooks.d/timesyncd

And if you now run a dhcp based time server push it will fail very badly.

P.S. This is triggered by the chrony autopkgtests but not an issue in chrony yet it is in systemd.
But due to that one can use [1] as easy reproducer, I wonder how systemd slipped by this issue in autopkgtest?

It contains:
        systemctl try-restart systemd-timesyncd.service || true

Which in the setup the system now has will trigger:
 sudo dhclient dummy0
Failed to try-restart systemd-timesyncd.service: Unit systemd-timesyncd.service is masked.

P.S. I'll harden the chrony test to not stumble over this but it should be revisited for systemd to provide a better fix than causing this message every time (maybe pre-check if it is enabled and unmasked)?

[1]: https://git.launchpad.net/ubuntu/+source/chrony/tree/debian/tests/time-sources-from-dhcp-servers?h=ubuntu/focal-devel

Related branches

Chrony fix in focal completed tests and should migrate any minute.
But as that is only a mitigation of the symptoms not a fix to the problem in systemd-timesyncd at all.

Changed in chrony (Ubuntu):
status: New → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package chrony - 3.5-6ubuntu5

---------------
chrony (3.5-6ubuntu5) focal; urgency=medium

  * d/t/control: harden time-sources-from-dhcp-servers test for systemd change
    (LP: #1873031)

chrony (3.5-6ubuntu4) focal; urgency=medium

  * debian/postrm:
    - Stop starting systemd-timesyncd in postrm. This is no longer relevant
      since systemd-timesyncd is a standalone package declaring
      Conflicts/Replaces/Provides: time-daemon. (Closes 955773, LP: #1872183)

 -- Christian Ehrhardt <email address hidden> Wed, 15 Apr 2020 18:23:10 +0200

Changed in chrony (Ubuntu):
status: Fix Committed → Fix Released
Balint Reczey (rbalint) on 2020-04-16
Changed in systemd (Ubuntu):
assignee: nobody → Balint Reczey (rbalint)
Balint Reczey (rbalint) wrote :

Forwarded the systemd part: https://salsa.debian.org/systemd-team/systemd/-/merge_requests/89

The systemd part only emits an error from the dhclient hook, thus the DHCP based NTP updates are not broken.
I'll fix systemd in the next update after Focal's release.

Changed in systemd (Ubuntu Bionic):
status: New → Invalid
Changed in systemd (Ubuntu Eoan):
status: New → Invalid
Changed in systemd (Ubuntu):
status: New → In Progress
importance: Undecided → Medium
Balint Reczey (rbalint) on 2020-04-20
summary: - 245.4-2ubuntu1 has broken dhcp based NTP updates
+ 245.4-2ubuntu1 has broken chrony autopkgtest
summary: - 245.4-2ubuntu1 has broken chrony autopkgtest
+ 245.4-2ubuntu1 throws stderr messages on timesyncd restart in its dhcp
+ hook
no longer affects: chrony (Ubuntu Bionic)
no longer affects: chrony (Ubuntu Eoan)
Mathew Hodson (mhodson) on 2020-04-24
no longer affects: systemd (Ubuntu Eoan)
no longer affects: systemd (Ubuntu Bionic)
Mathew Hodson (mhodson) on 2020-04-29
Changed in chrony (Ubuntu):
importance: Undecided → High
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 245.6-1ubuntu1

---------------
systemd (245.6-1ubuntu1) groovy; urgency=medium

  [ Balint Reczey ]
  * Merge to Ubuntu from Debian unstable
  - Dropped changes:
    * Don't try calling NULL callback in bus_wait_for_units_clear.
    * test: Skip test-boot-timestamps on permission denied.
    * From journald: stream pid change newline fix
      - debian/patches/lp1875708/journald-Increase-stdout-buffer-size-sooner-when-almost-f.patch
    * meson: initialize time-epoch to reproducible builds compatible value
  * dhclient-exit-hooks.d/timesyncd: Act only when systemd-timesyncd is enabled
    (LP: #1873031)
    File: debian/extra/dhclient-exit-hooks.d/timesyncd
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=7d5a31fb7523d1ecef0d2932df5efa3b99322919
  * debian/udev.postinst: Allow kvm to be an already present non-system group
    (LP: #1880541)
    File: debian/udev.postinst
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=8b5c31828d4323ddb719326b1316c179b7cdbdef
  * Cherry-pick reversion of detecting WSL by the presence of "microsoft" in osrelease
    File: debian/patches/Revert-detect-virt-also-detect-microsoft-as-WSL.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=e13f4452698b84ecb0ca6b7950b5f0c42c02c2cf

  [ Ryan Harper ]
  * Skip over by-uuid/by-label symlinks for bcache backing and cache devices
    (LP: #1861941)
    File: debian/patches/lp1861941-dont-generate-disk-byuuid-for-bcache-uuid.patch
    https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=4b9a0e888ca40eaed561ec48aece23218fab18ff

systemd (245.6-1) unstable; urgency=medium

  [ Michael Biebl ]
  * New upstream version 245.6
  * Rebase patches

  [ Balint Reczey ]
  * debian/tests/boot-and-services: Handle missing fstab (LP: #1877078)

 -- Balint Reczey <email address hidden> Thu, 11 Jun 2020 12:54:02 +0200

Changed in systemd (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers