autopkgtest identified fighting time services
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
chrony (Ubuntu) |
Fix Released
|
Critical
|
Unassigned |
Bug Description
This SRU Template is meant to help the release team accepting this into focal before release.
[Impact]
Important:
The fix to avoid the services running concurrently moved
to bug 1849156 - this upload will only fix the test issues now.
I'll keep the test steps below as I'll want to test them with
the new systemd-timesyncd then.
* Over the years there were multiple approaches to adapt different time
service like ntp/chrony/
Debian changes (3.5-6) fixed a certain type of issues of the former
solution (conflicts) but opened another issue after install until
reboot where now multiple service are active.
Overall this:
* Fix autopkgtests to not have chrony installed (fighting with the chrony
service started by the tests)
* Fix autopkgtests to disable systemd-timesyncd to not fight over the
clock
* Reload systemd-timesyncd after chrony install to pick up the drop in
config placed by chrony
* Adding a new test that ensures this is detected earlier in the future
in case it reoccurs (again)
[Test Case]
* Install chrony, the state should be:
- chrony running
- systemd-timesyncd inactive
=> That should persist over reboots
=> In Ubuntu that even applies to containers
* Check new (and old) autopkgtest results
[Regression Potential]
* I don't think it is an issue , but I could see potential regressions in
the restart of systemctl-timesyncd if people made customizations to it.
Therefore we ignore the RC to not break chrony install - but it would
be "please fix your config" as usual. Also important is that this would
not be different to the situation these users would have had after a
reboot.
[Other Info]
* n/a
----
FYI Separated from bug 1867036
It seems to be racy/flaky.
It uses a comparison on "seconds" granularity.
I was adding debug to check the values it fails on.
It was somewhat reproducible in the bileto ticket (again autopkgtest infrastructure).
Therefore I inserted some debug code and re-ran it there.
Our test environment is too fast (sometimes) and hence the flakyness:
checking chronyc output OK
DEBUG before 1585747433
DEBUG before 1585747433
checking system clock BAD
That is checked with "lt" and here the results are ==.
I'll need to discuss if there is a strict reason for these to be non-equal.
Otherwise the fix might be as easy as using "-le" instead
Related branches
- Lucas Kanashiro (community): Approve
- Canonical Server packageset reviewers: Pending requested
- git-ubuntu developers: Pending requested
-
Diff: 106 lines (+62/-0)5 files modifieddebian/changelog (+9/-0)
debian/postinst (+6/-0)
debian/tests/check-services (+38/-0)
debian/tests/control (+4/-0)
debian/tests/upstream-system-tests (+5/-0)
description: | updated |
description: | updated |
starting chronyd OK system/ chrony. service; enabled; vendor preset: enabled)
man: chronyc( 1)
man: chrony. conf(5) slice/chrony. service
running chronyc dfreq 1e-3 OK
checking chronyc output OK
DATE 1 1585758870
running chronyc doffset -30.0 OK
DATE 2 1585758870
checking chronyc output OK
DATE 3 1585758870
running chronyc makestep OK
DATE 4 1585758870
checking chronyc output OK
DATE 5 1585758870
DATE S1 1585758870
DATE SET Wed Apr 1 16:34:35 UTC 2020
DATE S2 1585758870
DEBUG before 1585758870
DEBUG after 1585758870
DEBUG S1: * chrony.service - chrony, an NTP client/server
Loaded: loaded (/lib/systemd/
Active: active (running) since Wed 2020-04-01 16:34:25 UTC; 4s ago
Docs: man:chronyd(8)
Main PID: 5499 (chronyd)
Tasks: 2 (limit: 1660)
Memory: 5.9M
CGroup: /system.
|-5499 /usr/sbin/chronyd -F -1
`-5500 /usr/sbin/chronyd -F -1
Apr 01 16:34:25 autopkgtest systemd[1]: Starting chrony, an NTP client/server... timesyncd. service - Network Time Synchronization system/ systemd- timesyncd. service; enabled; vendor preset: enabled) systemd/ system/ systemd- timesyncd. service. d
` -disable- with-time- daemon. conf timesyncd. service( 8) slice/systemd- timesyncd. service systemd- timesyncd
Apr 01 16:34:25 autopkgtest chronyd[5499]: chronyd version 3.5 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 -DEBUG)
Apr 01 16:34:25 autopkgtest chronyd[5499]: Loaded seccomp filter
Apr 01 16:34:25 autopkgtest systemd[1]: Started chrony, an NTP client/server.
DEBUG S2: * systemd-
Loaded: loaded (/lib/systemd/
Drop-In: /usr/lib/
Active: active (running) since Wed 2020-04-01 16:33:44 UTC; 45s ago
Docs: man:systemd-
Main PID: 602 (systemd-timesyn)
Status: "Initial synchronization to time server 91.189.91.157:123 (ntp.ubuntu.com)."
Tasks: 2 (limit: 1660)
Memory: 8.0M
CGroup: /system.
`-602 /lib/systemd/
Apr 01 16:33:43 autopkgtest systemd[1]: Starting Network Time Synchronization... timesyncd[ 602]: Initial synchronization to time server 91.189.91.157:123 (ntp.ubuntu.com). t.ChF59G/ build.rot/ src/test/ system/ tmp/chronyd. log -f /tmp/autopkgtes t.ChF59G/ build.rot/ src/test/ system/ tmp/chronyd. conf -u root
Apr 01 16:33:44 autopkgtest systemd[1]: Started Network Time Synchronization.
Apr 01 16:33:45 autopkgtest systemd-
DEBUG O1:
DEBUG O2:
DEBUG P1: 0 0 6057 6055 20 0 5056 1792 pipe_w S ? 0:00 \_ grep chronyd
5 111 5499 1 20 0 15104 4160 do_sel S ? 0:00 /usr/sbin/chronyd -F -1
1 111 5500 5499 20 0 7104 4224 skb_wa S ? 0:00 \_ /usr/sbin/chronyd -F -1
5 0 6028 1 20 0 6656 4160 do_sel S ? 0:00 ../../chronyd -l /tmp/autopkgtes
checking system clock ...