On Tue, Jul 30, 2019 at 12:05:23AM -0700, Ross Boylan wrote:
See below.

On Mon, Jul 29, 2019 at 5:39 PM Vincent Blut <vincent.deb...@free.fr> wrote:
....
Hello Ross,

On Mon, Jul 29, 2019 at 12:13:16PM -0700, Ross Boylan wrote:
....
>It looks as if systemd-timesyncd is creating a stop job for chrony
>even though the former includes
,,,,

What’s the status of systemd-timesyncd here? Is it started?

I'm never sure with systemd exactly which things I should focus on for
the status, but the results below see to indicate systemd-timesyncd is
not running even though it's enabled.  The start condition failed,
which I gather is not quite good enough to assure it never started.

root@barley:~# systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
  Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service;
enabled; vendor preset: enabled)
 Drop-In: /usr/lib/systemd/system/systemd-timesyncd.service.d
          └─disable-with-time-daemon.conf
  Active: inactive (dead)
Condition: start condition failed at Mon 2019-07-29 12:35:49 PDT; 11h ago
          └─ ConditionFileIsExecutable=!/usr/sbin/chronyd was not met
    Docs: man:systemd-timesyncd.service(8)

Jul 29 12:35:49 barley systemd[1]: Condition check resulted in Network Time…ped.
Hint: Some lines were ellipsized, use -l to show in full.

For the avoidance of doubt, this is the result right after booting your system?
Anyway, this is the expected state.

Also, could you attach the output of:
$ systemctl show systemd-timesyncd.service

root@barley:~# date; systemctl show systemd-timesyncd.service
[snip…]

Nothing seems suspicious here. However, I observe that systemd-timesyncd is pulled in way earlier than chronyd (and all other NTP implementation provided in Debian) in the boot process. This is due to its unit file which contains sysinit.target in the “Before=” dependency directive.

Thanks for these logs. To have a bigger picture, could you please show me something like that instead:
$ journalctl -b | grep -E "(chrony|timesync)"

# xzcat journal201907291130.xz | grep -E "(chrony|timesync)"
Jul 29 11:30:43 barley systemd[1]: Pulling in
systemd-timesyncd.service/start from sysinit.target/start
Jul 29 11:30:43 barley systemd[1]: Added job
systemd-timesyncd.service/start to transaction.
Jul 29 11:30:43 barley systemd[1]: Pulling in system.slice/start from
systemd-timesyncd.service/start
Jul 29 11:30:43 barley systemd[1]: Pulling in var.mount/start from
systemd-timesyncd.service/start
Jul 29 11:30:43 barley systemd[1]: Pulling in -.mount/start from
systemd-timesyncd.service/start
Jul 29 11:30:43 barley systemd[1]: Pulling in time-sync.target/start
from systemd-timesyncd.service/start
Jul 29 11:30:43 barley systemd[1]: Pulling in shutdown.target/stop
from systemd-timesyncd.service/start
Jul 29 11:30:43 barley systemd[1]: Pulling in chrony.service/stop from
systemd-timesyncd.service/start
Jul 29 11:30:43 barley systemd[1]: Added job chrony.service/stop to transaction.
Jul 29 11:30:43 barley systemd[1]: Pulling in chrony.service/start
from multi-user.target/start
Jul 29 11:30:43 barley systemd[1]: Added job chrony.service/start to
transaction.
Jul 29 11:30:43 barley systemd[1]: Pulling in sysinit.target/start
from chrony.service/start
Jul 29 11:30:43 barley systemd[1]: Pulling in system.slice/start from
chrony.service/start
Jul 29 11:30:43 barley systemd[1]: Pulling in -.mount/start from
chrony.service/start
Jul 29 11:30:43 barley systemd[1]: Pulling in var.mount/start from
chrony.service/start
Jul 29 11:30:43 barley systemd[1]: Pulling in ntp.service/stop from
chrony.service/start
Jul 29 11:30:43 barley systemd[1]: Pulling in openntpd.service/stop
from chrony.service/start
Jul 29 11:30:43 barley systemd[1]: Pulling in ntpsec.service/stop from
chrony.service/start
Jul 29 11:30:43 barley systemd[1]: Pulling in shutdown.target/stop
from chrony.service/start
Jul 29 11:30:43 barley systemd[1]: Pulling in
systemd-timesyncd.service/stop from chrony.service/start
Jul 29 11:30:43 barley systemd[1]: Added job
systemd-timesyncd.service/stop to transaction.
Jul 29 11:30:43 barley systemd[1]: chrony.service: Looking at job
chrony.service/start conflicted_by=no
Jul 29 11:30:43 barley systemd[1]: chrony.service: Looking at job
chrony.service/stop conflicted_by=no
Jul 29 11:30:43 barley systemd[1]: chrony.service: Fixing conflicting
jobs chrony.service/start,chrony.service/stop by deleting job
chrony.service/stop
Jul 29 11:30:43 barley systemd[1]: systemd-timesyncd.service: Looking
at job systemd-timesyncd.service/stop conflicted_by=yes
Jul 29 11:30:43 barley systemd[1]: systemd-timesyncd.service: Looking
at job systemd-timesyncd.service/start conflicted_by=no
Jul 29 11:30:43 barley systemd[1]: systemd-timesyncd.service: Fixing
conflicting jobs
systemd-timesyncd.service/stop,systemd-timesyncd.service/start by
deleting job systemd-timesyncd.service/start

So far, the initial transactions seem correctly done:
↳systemd-timesyncd.service starts before sysinit.target
 ↳units conflicting with systemd-timesyncd are stopped
   ↳multi-user.target starts
     ↳chrony.service starts
       ↳systemd-timesyncd.service stops

Jul 29 11:30:43 barley systemd[1]: Found redundant job
systemd-timesyncd.service/stop, dropping from transaction.
Jul 29 11:30:43 barley systemd[1]: chrony.service: Installed new job
chrony.service/start as 163
Jul 29 11:30:43 barley systemd[1]: run-systemd-timesync.mount: Collecting.
Jul 29 11:30:43 barley systemd[1]: var-lib-systemd-timesync.mount: Collecting.
Jul 29 11:30:44 barley systemd-sysusers[599]: Group systemd-timesync
already exists.
Jul 29 11:30:44 barley systemd-sysusers[599]: User systemd-timesync
already exists.
Jul 29 11:30:46 barley systemd[1]: Pulling in
systemd-timesyncd.service/start from sysinit.target/start

And here we can see that before starting sysinit.target (again), systemd-timesyncd.service is started.

Jul 29 11:30:46 barley systemd[1]: Added job
systemd-timesyncd.service/start to transaction.
Jul 29 11:30:46 barley systemd[1]: Pulling in system.slice/start from
systemd-timesyncd.service/start
Jul 29 11:30:46 barley systemd[1]: Pulling in var.mount/start from
systemd-timesyncd.service/start
Jul 29 11:30:46 barley systemd[1]: Pulling in -.mount/start from
systemd-timesyncd.service/start
Jul 29 11:30:46 barley systemd[1]: Pulling in time-sync.target/start
from systemd-timesyncd.service/start
Jul 29 11:30:46 barley systemd[1]: Pulling in shutdown.target/stop
from systemd-timesyncd.service/start
Jul 29 11:30:46 barley systemd[1]: Pulling in chrony.service/stop from
systemd-timesyncd.service/start

systemd-timesyncd.service wants chrony.service to be stopped to continue.

Jul 29 11:30:46 barley systemd[1]: Added job chrony.service/stop to transaction.
Jul 29 11:30:46 barley systemd[1]: chrony.service: chrony.service/stop
would change existing job.
Jul 29 11:30:46 barley systemd[1]: chrony.service: Deleting
chrony.service/stop to minimize impact.

Here I’m not sure about what’s happening. I *think* that systemd rejects
the request for the chrony.service to be stopped.

Jul 29 11:30:46 barley systemd[1]: Keeping job
systemd-timesyncd.service/start because of sysinit.target/start

But sysinit.target really needs systemd-timesyncd.service to be started before starting.

Jul 29 11:30:46 barley systemd[1]: Keeping job var.mount/start because
of systemd-timesyncd.service/start
Jul 29 11:30:46 barley systemd[1]: systemd-timesyncd.service:
Installed new job systemd-timesyncd.service/start as 334
[snip…]
Jul 29 11:30:47 barley systemd[1]: Pulling in
systemd-timesyncd.service/start from sysinit.target/start

And again.

Jul 29 11:30:47 barley systemd[1]: Added job
systemd-timesyncd.service/start to transaction.
[snip…]
systemd-timesyncd.service/start into installed job
systemd-timesyncd.service/start as 334
Jul 29 11:30:47 barley systemd[1]: Pulling in
systemd-timesyncd.service/start from sysinit.target/start

And again.

Jul 29 11:30:47 barley systemd[1]: Added job
systemd-timesyncd.service/start to transaction.
[snip…]
systemd-timesyncd.service/start into installed job
systemd-timesyncd.service/start as 334
Jul 29 11:30:47 barley systemd[1]: Pulling in
systemd-timesyncd.service/start from sysinit.target/start

And again.

Jul 29 11:30:47 barley systemd[1]: Added job
systemd-timesyncd.service/start to transaction.
[snip…]
Jul 29 11:30:50 barley systemd[1]: Pulling in
systemd-timesyncd.service/start from sysinit.target/start

And again.

Jul 29 11:30:50 barley systemd[1]: Added job
systemd-timesyncd.service/start to transaction.
transaction.
[snip…]
Jul 29 11:30:50 barley systemd[1]: Keeping job chrony.service/stop
because of systemd-timesyncd.service/start
Jul 29 11:30:50 barley systemd[1]: Keeping job
systemd-timesyncd.service/start because of sysinit.target/start
Jul 29 11:30:50 barley systemd[1]: Keeping job var.mount/start because
of systemd-timesyncd.service/start
Jul 29 11:30:50 barley systemd[1]: chrony.service: Job 163
chrony.service/start finished, result=canceled

Finally, chrony.service start-up is canceled.

Jul 29 11:30:50 barley systemd[1]: chrony.service: Installed new job
chrony.service/stop as 831
Jul 29 11:30:50 barley systemd[1]: systemd-timesyncd.service: Merged
systemd-timesyncd.service/start into installed job
systemd-timesyncd.service/start as 334
Jul 29 11:30:50 barley systemd[1]: chrony.service: Job 831
chrony.service/stop finished, result=done

Therefore, chrony.service is now stopped for good. That means that systemd-timesyncd can take over…

Jul 29 11:30:52 barley systemd[1]: systemd-timesyncd.service:
ConditionFileIsExecutable=!/usr/sbin/VBoxService succeeded.
Jul 29 11:30:52 barley systemd[1]: systemd-timesyncd.service:
ConditionFileIsExecutable=!/usr/sbin/chronyd failed.
Jul 29 11:30:52 barley systemd[1]: systemd-timesyncd.service: Starting
requested but condition failed. Not starting unit.

…But can’t because “/usr/sbin/chronyd” is a valid executable.
So that leaves us with both systemd-timesyncd and chronyd stopped. Sigh!

There are some other things from your request still for me to do.

If you need help for overriding the chrony.service file, don’t hesitate to ask.

Ross

Cheers,
Vincent

Attachment: signature.asc
Description: PGP signature

Reply via email to