systemd-timesyncd.service not starting

Bug #1854582 reported by doctordruidphd
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
New
Undecided
Unassigned

Bug Description

Kubuntu -19.10 (though I believe the problem also exists on prior versions)

Time synchronization not working:

----------
<email address hidden> /lib/systemd/system$ timedatectl status
               Local time: Sat 2019-11-30 08:21:57 PST
           Universal time: Sat 2019-11-30 16:21:57 UTC
                 RTC time: Sat 2019-11-30 16:21:57
                Time zone: America/Los_Angeles (PST, -0800)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no

<email address hidden> /lib/systemd/system$ 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) since Sat 2019-11-30 08:21:28 PST; 2min 0s ago
Condition: start condition failed at Sat 2019-11-30 08:23:15 PST; 12s ago
           └─ ConditionFileIsExecutable=!/usr/sbin/VBoxService was not met
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 813 (code=exited, status=0/SUCCESS)
   Status: "Shutting down..."

Nov 30 07:29:50 Crynfyd systemd[1]: Starting Network Time Synchronization...
Nov 30 07:29:51 Crynfyd systemd[1]: Started Network Time Synchronization.
Nov 30 07:30:21 Crynfyd systemd-timesyncd[813]: Synchronized to time server for the first time 91.189.
Nov 30 08:21:28 Crynfyd systemd[1]: Stopping Network Time Synchronization...
Nov 30 08:21:28 Crynfyd systemd[1]: systemd-timesyncd.service: Succeeded.
Nov 30 08:21:28 Crynfyd systemd[1]: Stopped Network Time Synchronization.
Nov 30 08:23:15 Crynfyd systemd[1]: Condition check resulted in Network Time Synchronization being ski

----------

The problem has to do with the file
/lib/systemd/system/systemd-timesyncd.service.d/disable-with-time-daemon.conf;

----------
<email address hidden> /lib/systemd/system/systemd-timesyncd.service.d$ cat disable-with-time-daemon.conf
[Unit]
# don't run timesyncd if we have another NTP daemon installed
ConditionFileIsExecutable=!/usr/sbin/ntpd
ConditionFileIsExecutable=!/usr/sbin/openntpd
ConditionFileIsExecutable=!/usr/sbin/chronyd
ConditionFileIsExecutable=!/usr/sbin/VBoxService
----------

I do have virtualbox installed, but not running, so VBoxService is not running.
This means that although the binary is there, it is not providing time sync services, so the system is not time syncing. If I remove the line "ConditionFileIsExecutable=!/usr/sbin/VBoxService" from the file and restart, all is well:

----------
<email address hidden> /lib/systemd/system/systemd-timesyncd.service.d$ sudo systemctl daemon-reload
<email address hidden> /lib/systemd/system/systemd-timesyncd.service.d$ sudo systemctl restart systemd-timesyncd.service
<email address hidden> /lib/systemd/system/systemd-timesyncd.service.d$ timedatectl status
               Local time: Sat 2019-11-30 08:29:43 PST
           Universal time: Sat 2019-11-30 16:29:43 UTC
                 RTC time: Sat 2019-11-30 16:29:43
                Time zone: America/Los_Angeles (PST, -0800)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
----------

So instead of testing just for the existence of the binary, which is resulting in no time sync service, what it probably should do is check for a running process, and allow the service to start if no other time syncing service is running.

Revision history for this message
Dan Streetman (ddstreet) wrote :

This isn't exactly the same issue as bug 1849156 (that is about ntp condition check conflict, this is virtualbox), but it's close enough as the cause is the same - the drop-in file simply checking for the presence of specific executable files, instead of checking for running process/service.

I'm duping to that bug, but if you disagree please feel free to un-dup.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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