Skip to content

override chronyd.service with Wants=chrony-wait.service - #7374

Open
semarie wants to merge 1 commit into
xapi-project:masterfrom
xcp-ng:dev/srt/master/chrony-wait
Open

semarie wants to merge 1 commit into
xapi-project:masterfrom
xcp-ng:dev/srt/master/chrony-wait

Conversation

@semarie

@semarie semarie commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

xapi.service already follows the consumer side of the time-sync.target contract in systemd.special(7): services that need a synced clock order themselves After=time-sync.target without pulling it in. Pulling the target in is the provider's job, here chrony-wait. The gap is that chrony-wait isn't tied to chronyd: it should run if and only if chronyd does.

The commit makes xapi to ship drop-in for chronyd in the xapi package.

The chrony-wait.service itself should be left not enabled.

  • host-installer should stop enabling chrony-wait at install time
  • xsconsole should stop managing chrony-wait (it is stopped when disabling NTP)
  • for migration, systemctl disable chrony-wait.service should be run

Fixes: #7363

@semarie

semarie commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Regarding migration, what would be the better way to run systemctl disable chrony-wait.service ?

It could be run:

  • at packaging time (%posttrans)
  • run by xapi at startup if the service is enabled ?

@semarie
semarie force-pushed the dev/srt/master/chrony-wait branch from 6a461ff to 56d931a Compare November 2, 2026 14:07
@semarie

semarie commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Last push:

  • use chronyd.service.d (instead of chrony.service.d, wrong unit name)

`xapi.service` already follows the consumer side of the `time-sync.target` 
contract in systemd.special(7): services that need a synced clock order 
themselves `After=time-sync.target` without pulling it in. Pulling the target in 
is the provider's job, here chrony-wait. The gap is that chrony-wait isn't tied 
to chronyd: it should run if and only if chronyd does.

The commit makes xapi to ship drop-in for chronyd in the xapi package.

The `chrony-wait.service` itself should be left not enabled.

- `host-installer` should stop enabling chrony-wait at install time
- `xsconsole` should stop managing chrony-wait (it is stopped when disabling NTP)
- for migration, `systemctl disable chrony-wait.service` should be run

Fixes: xapi-project#7363

Signed-off-by: Sebastien Rodot <sebastien.rodot@vates.tech>
@semarie
semarie force-pushed the dev/srt/master/chrony-wait branch from 56d931a to db0099d Compare November 2, 2026 14:24

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NTP: chrony-wait.service lifecycle is not tied to ntp-mode, so disabling NTP doesn't survive a reboot

1 participant