systemd-timesyncd.service broken on upgrade to 19.10 if ntp was installed

Bug #1849156 reported by Paul Buonopane
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
systemd (Debian)
Fix Released
Unknown
systemd (Ubuntu)
Fix Released
High
Balint Reczey
Eoan
Won't Fix
High
Unassigned
Focal
Fix Released
High
Balint Reczey

Bug Description

Ubuntu 19.10's systemd package introduced /lib/systemd/system/systemd-timesyncd.service.d/disable-with-time-daemon.conf. This prevents systemd-timesyncd.service from starting if the ntp package has been installed. However, ntp.service has a Conflicts directive for systemd-timesyncd.service. If both services are enabled, neither will start on boot. This breaks upgrades from < 19.10 to 19.10 for systems that have both ntp and systemd installed.

Possible workarounds:

- Uninstall ntp
- Disable systemd-timesyncd.service

% lsb_release -rd
Description: Ubuntu 19.10
Release: 19.10

% apt-cache policy systemd
systemd:
  Installed: 242-7ubuntu3
  Candidate: 242-7ubuntu3
  Version table:
 *** 242-7ubuntu3 500
        500 http://us-east-1.ec2.archive.ubuntu.com/ubuntu eoan/main amd64 Packages
        100 /var/lib/dpkg/status

% apt-cache policy ntp
ntp:
  Installed: 1:4.2.8p12+dfsg-3ubuntu2
  Candidate: 1:4.2.8p12+dfsg-3ubuntu2
  Version table:
 *** 1:4.2.8p12+dfsg-3ubuntu2 500
        500 http://us-east-1.ec2.archive.ubuntu.com/ubuntu eoan/universe amd64 Packages
        100 /var/lib/dpkg/status

% dpkg -S /lib/systemd/system/systemd-timesyncd.service.d/disable-with-time-daemon.conf
systemd: /lib/systemd/system/systemd-timesyncd.service.d/disable-with-time-daemon.conf

% sudo systemctl status ntp
● ntp.service - Network Time Service
   Loaded: loaded (/lib/systemd/system/ntp.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:ntpd(8)

% sudo systemctl status systemd-timesyncd.service
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
           └─disable-with-time-daemon.conf
   Active: inactive (dead)
Condition: start condition failed at Mon 2019-10-21 12:05:38 EDT; 29s ago
     Docs: man:systemd-timesyncd.service(8)

Oct 21 12:05:38 ubuntu systemd[1]: Condition check resulted in Network Time Synchronization being skipped.

Revision history for this message
Paul Buonopane (zenexer) wrote :

I realize that the title makes it sound as though this is intended behavior. To be clear, in this scenario, neither systemd-timesyncd.service nor ntp.service start. It's not just systemd-timesyncd.service that doesn't start, as that would be intended behavior.

Revision history for this message
Balint Reczey (rbalint) wrote :

disable-with-time-daemon.conf was reintroduced after observing the regression reported at:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=902026

The final solution is being discussed at https://github.com/systemd/systemd/issues/7104 .

I'm tempted to just split systemd-timesyncd to a separate package and let .deb Conflicts take care of this. @xnox, what do you think?

Changed in systemd (Ubuntu):
status: New → Confirmed
tags: added: rls-ee-incoming
Balint Reczey (rbalint)
Changed in systemd (Ubuntu):
assignee: nobody → Balint Reczey (rbalint)
Changed in ntp (Ubuntu):
assignee: nobody → Balint Reczey (rbalint)
tags: removed: rls-ee-incoming
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

given that dropins are not working well enough, we need something better.

Possibly we need a generator that disables things harder.

Or update alternatives.

But the problem is that timesyncd should only be a fallback....

tags: added: id-5dbb33265d09bf5e5d2ca5df
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ntp (Ubuntu Eoan):
status: New → Confirmed
Changed in ntp (Ubuntu):
status: New → Confirmed
Changed in systemd (Ubuntu Eoan):
status: New → Confirmed
Revision history for this message
Mark - Syminet (mark-syminet) wrote :

Got bit by this as well, recall fixing it a few years ago but must have clobbered my changes on upgrade bionic -> eoan? Having VirtualBox installed broke it, fix was to comment out this line in /lib/systemdd/system/systemd-timesyncd.service.d and restart systemd:

ConditionFileIsExecutable=!/usr/sbin/VBoxService

Don't recall being asked about a config file change during upgrade although maybe it did and didn't remember. Further info here:

https://askubuntu.com/questions/940311/time-in-ubuntu-16-04-not-updating-from-internet#1005355

Revision history for this message
Petr Nosek (petr-nosek) wrote : Re: [Bug 1849156] Re: systemd-timesyncd.service broken on upgrade to 19.10 if ntp was installed
Download full text (3.8 KiB)

hi, thank you for reply.

comment out line: ConditionFileIsExecutable=!/usr/sbin/VBoxService
works for me.

I had to comment out so line:
ConditionFileIsExecutable=!/usr/sbin/VBoxService

Both are commented out and timesyncd works.

Thank you.

Petr

út 11. 2. 2020 v 7:10 odesílatel Mark - Syminet <email address hidden>
napsal:

> Got bit by this as well, recall fixing it a few years ago but must have
> clobbered my changes on upgrade bionic -> eoan? Having VirtualBox
> installed broke it, fix was to comment out this line in
> /lib/systemdd/system/systemd-timesyncd.service.d and restart systemd:
>
> ConditionFileIsExecutable=!/usr/sbin/VBoxService
>
> Don't recall being asked about a config file change during upgrade
> although maybe it did and didn't remember. Further info here:
>
> https://askubuntu.com/questions/940311/time-in-ubuntu-16-04-not-
> updating-from-internet#1005355
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1849156
>
> Title:
> systemd-timesyncd.service broken on upgrade to 19.10 if ntp was
> installed
>
> Status in ntp package in Ubuntu:
> Confirmed
> Status in systemd package in Ubuntu:
> Confirmed
> Status in ntp source package in Eoan:
> Confirmed
> Status in systemd source package in Eoan:
> Confirmed
> Status in ntp source package in Focal:
> Confirmed
> Status in systemd source package in Focal:
> Confirmed
>
> Bug description:
> Ubuntu 19.10's systemd package introduced /lib/systemd/system/systemd-
> timesyncd.service.d/disable-with-time-daemon.conf. This prevents
> systemd-timesyncd.service from starting if the ntp package has been
> installed. However, ntp.service has a Conflicts directive for
> systemd-timesyncd.service. If both services are enabled, neither will
> start on boot. This breaks upgrades from < 19.10 to 19.10 for systems
> that have both ntp and systemd installed.
>
> Possible workarounds:
>
> - Uninstall ntp
> - Disable systemd-timesyncd.service
>
> % lsb_release -rd
> Description: Ubuntu 19.10
> Release: 19.10
>
> % apt-cache policy systemd
> systemd:
> Installed: 242-7ubuntu3
> Candidate: 242-7ubuntu3
> Version table:
> *** 242-7ubuntu3 500
> 500 http://us-east-1.ec2.archive.ubuntu.com/ubuntu eoan/main
> amd64 Packages
> 100 /var/lib/dpkg/status
>
> % apt-cache policy ntp
> ntp:
> Installed: 1:4.2.8p12+dfsg-3ubuntu2
> Candidate: 1:4.2.8p12+dfsg-3ubuntu2
> Version table:
> *** 1:4.2.8p12+dfsg-3ubuntu2 500
> 500 http://us-east-1.ec2.archive.ubuntu.com/ubuntu
> eoan/universe amd64 Packages
> 100 /var/lib/dpkg/status
>
> % dpkg -S
> /lib/systemd/system/systemd-timesyncd.service.d/disable-with-time-daemon.conf
> systemd:
> /lib/systemd/system/systemd-timesyncd.service.d/disable-with-time-daemon.conf
>
> % sudo systemctl status ntp
> ● ntp.service - Network Time Service
> Loaded: loaded (/lib/systemd/system/ntp.service; enabled; vendor
> preset: enabled)
> Active: inactive (dead)
> Docs: man:ntpd(8)
>
> % sudo systemctl status systemd-timesyncd.service
> ● s...

Read more...

Revision history for this message
Balint Reczey (rbalint) wrote :

For the record the solution is under review at https://salsa.debian.org/systemd-team/systemd/merge_requests/61

Changed in systemd (Ubuntu Focal):
status: Confirmed → In Progress
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Debian MP is merged at the end of last Week.
It is in 245.4-2 in debian/unstable since Saturday.
It is not yet in 245.2-1ubuntu3 which is the current focal-proposed.

I was working on bug 1870144 and considering to modify timesyncd there, but seeing this change coming I'll (on the chrony side) only fix the tests but leave this upload to systemd.

@Rbalint - please let me know if you expect this to not land in time for 20.04.
Because then I need to have chrony stopping systemd-timesyncd on install to avoid both are running concurrently.

Revision history for this message
Balint Reczey (rbalint) wrote :

@paelzer I'm landing this fix in next upload.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Great @rbalint - the chrony test fixes have landed ~1h ago.
Combined with your upload this should be ok then - thanks!

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (17.0 KiB)

This bug was fixed in the package systemd - 245.4-2ubuntu1

---------------
systemd (245.4-2ubuntu1) focal; urgency=medium

  [ Balint Reczey ]
  * Merge to Ubuntu from Debian unstable
  * Refresh patches
    - Dropped changes:
      * units: Don't mount tracefs in LXC.
    - Remaining changes:
      * Specify Ubuntu's Vcs-Git
        File: debian/control
        https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=fd832930ef280c9a4a9dda2440d5a46a6fdb6232
      * Enable EFI/bootctl on armhf.
        File: debian/control
        https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=043122f7d8a1487bfd357e815a6ece1ceea6e7d1
      * Recommend networkd-dispatcher
        File: debian/control
        https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=d1e3b2c7e4757119da0d550b0b3c0a6626a176dc
      * Add conflicts with upstart and systemd-shim
        File: debian/control
        https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=83ed7496afc7c27be026014d109855f7d0ad1176
      * debian/control: strengthen dependencies.
        File: debian/control
        https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=d1ecf0c372f5212129c85ae60fddf26b2271a1fe
      * debian/rules: Set -Duser-path instead of patching the source for the same result
        File: debian/rules
        https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=67d2ac5d806b55b0d178fca7e0af08cd9d12580c
      * config: tpm-pcrindex=12, on Ubuntu only.
        File: debian/rules
        https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=2f8c22d44a619ce8fa17eb0cd7c7e2c601cdbbeb
      * Ubuntu/extra: ship dhclient-enter hook.
        Files:
        - debian/extra/dhclient-enter-resolved-hook
        - debian/rules
        https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=f3398a213f80b02bf3db0c1ce9e22d69f6d56764
        https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=258893bae8cbb12670e4807636fe8f7e9fb5407a
        https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=0725c1169ddde4f41cacba7af3e546704e2206be
      * udev-udeb: ship modprobe.d snippet to force scsi_mod.scan=sync in d-i.
        Files:
        - debian/extra/modprobe.d-udeb/scsi-mod-scan-sync.conf
        - debian/udev-udeb.install
        https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=eb6d8a2b9504917abb7aa2c4035fdbb7b98227f7
      * debian/extra/start-udev: Set scsi_mod scan=sync even if it's builtin to the kernel (we previously only set it in modprobe.d)
        Files:
        - debian/extra/start-udev
        https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=6b72628f8de991e2c67ac4289fc74daf3abe7d14
      * debian/extra/units/systemd-resolved.service.d/resolvconf.conf:
        drop resolvconf.conf drop-in, resolved integration moved to resolvconf package.
      * debian/extra/wrap_cl.py: add changelog formatter
        Files:
        - debian/extra/wrap_cl.py
        - debian/gbp.conf
        https://git.launchpad.net/~ubuntu-c...

Changed in systemd (Ubuntu Focal):
status: In Progress → Fix Released
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

FYI - Hi Rbalint, this most likely has exposed/triggered bug 1872183

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

FYI : This also has broken dhcp based ntp info updates
This is hit by the chrony autopkgtests, how did you get this systemd upload to migrate without fixing that?

$ sudo dhclient dummy0
Failed to try-restart systemd-timesyncd.service: Unit systemd-timesyncd.service is masked.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I filed bug 1873031 for the latter

Mathew Hodson (mhodson)
tags: added: dist-upgrade
Mathew Hodson (mhodson)
no longer affects: ntp (Ubuntu)
no longer affects: ntp (Ubuntu Eoan)
no longer affects: ntp (Ubuntu Focal)
Changed in systemd (Ubuntu Eoan):
importance: Undecided → High
Changed in systemd (Ubuntu Focal):
importance: Undecided → High
Changed in systemd (Debian):
status: Unknown → Fix Released
Revision history for this message
Dan Streetman (ddstreet) wrote :

I'm marking this as wontfix for Eoan, as it's EOL in just a few weeks; please upgrade to Focal if still affected by this bug.

Changed in systemd (Ubuntu Eoan):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.