[Bug 1854582] [NEW] systemd-timesyncd.service not starting

doctordruidphd doctordruidphd at yahoo.com
Sat Nov 30 16:36:09 UTC 2019


Public bug reported:

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

Time synchronization not working:

----------
greenman at Crynfyd19.10 /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

greenman at Crynfyd19.10 /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;

----------
greenman at Crynfyd19.10 /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:

----------
greenman at Crynfyd19.10 /lib/systemd/system/systemd-timesyncd.service.d$ sudo systemctl daemon-reload
greenman at Crynfyd19.10 /lib/systemd/system/systemd-timesyncd.service.d$ sudo systemctl restart systemd-timesyncd.service
greenman at Crynfyd19.10 /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.

** Affects: systemd (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1854582

Title:
  systemd-timesyncd.service not starting

Status in systemd package in Ubuntu:
  New

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

  Time synchronization not working:

  ----------
  greenman at Crynfyd19.10 /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

  greenman at Crynfyd19.10 /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;

  ----------
  greenman at Crynfyd19.10 /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:

  ----------
  greenman at Crynfyd19.10 /lib/systemd/system/systemd-timesyncd.service.d$ sudo systemctl daemon-reload
  greenman at Crynfyd19.10 /lib/systemd/system/systemd-timesyncd.service.d$ sudo systemctl restart systemd-timesyncd.service
  greenman at Crynfyd19.10 /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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1854582/+subscriptions



More information about the foundations-bugs mailing list