timesyncd service not starting.

Hello again.

I’m getting errors related to NTP.
I check the status of timesyncd and see that it failed to start.

$ systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; disabled; vend
or 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 Wed 2020-07-08 19:08:04 BST; 6mi
n ago
           └─ ConditionFileIsExecutable=!/usr/sbin/VBoxService was not met
     Docs: man:systemd-timesyncd.service(8)

Starting it manually does not change the status.

The failure condition seems to be related to VBoxService (I am running dietpi in VirtualBox), but the service is required for a shared folder from the host machine to the dietpi virtual machine. I’m reading that timesyncd will not run while VBoxService is present to prevent conflicts. Any known work-arounds or alternatives that I can try? Searching did not return anything beyond what I’ve found so far.

Hi,

many thanks for your report. Pls can you post following

journalctl -u systemd-timesyncd.service

Thanks Joulinar,

Here is the output requested:

$ sudo journalctl -u systemd-timesyncd.service
-- Logs begin at Wed 2020-07-08 20:14:19 BST, end at Wed 2020-07-08 23:52:12 BST. --
Jul 08 20:14:21 DietPi2 systemd[1]: Condition check resulted in Network Time Synchronization being skipped.

usually time sync should be done via VBoxService if I’m not mistaken. However you could exclude VBoxService from being checked.

nano /lib/systemd/system/systemd-timesyncd.service.d/disable-with-time-daemon.conf

comment out line: ConditionFileIsExecutable=!/usr/sbin/VBoxService

Once done restart the service

systemctl daemon-reload
systemctl restart systemd-timesyncd.service

Thanks for the reply.

VBoxService may perform the same functionality, the time doesn’t seem wrong on the machine. It might be helpful to know what prompted me to try and resolve this, is that I keep seeing errors on system startup:

[INFO] DietPi-Run_NTPD | Waiting for completion of systemd-timesyncd (1/60)
[INFO] DietPi-Run_NTPD | Waiting for completion of systemd-timesyncd (2/60)
[INFO] DietPi-Run_NTPD | Waiting for completion of systemd-timesyncd (3/60)
etc…

This adds about a minute to the startup sequence, and I see the same warning count if I try and run the applets dietpi provides, for example the dietpi-software script. Upon which the NTPD Warning tries to have me retry and change the mirror used. Because the service isn’t running changing the mirror won’t resolve, and I’m forced to select override. This might be something that needs to be addressed for a future release, as I may not be the only person to use VirtualBox folder shares.

As for your suggestion, I’ll try it and report back.

yes, you could disable the time sync check in dietpi if you use VBoxService

dietpi@DietPi2:~$ sudo systemctl daemon-reload
dietpi@DietPi2:~$ sudo systemctl restart systemd-timesyncd.service

dietpi@DietPi2:~$ systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; disabled; vendor preset: enabled)
  Drop-In: /usr/lib/systemd/system/systemd-timesyncd.service.d
           └─disable-with-time-daemon.conf
   Active: active (running) since Thu 2020-07-09 01:07:36 BST; 19s ago
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 1733 (systemd-timesyn)
   Status: "Idle."
    Tasks: 2 (limit: 1171)
   Memory: 1.3M
   CGroup: /system.slice/systemd-timesyncd.service
           └─1733 /lib/systemd/systemd-timesyncd


dietpi@DietPi2:~$ sudo dietpi-software
[  OK  ] DietPi-Software | Initialised database
[  OK  ] DietPi-Software | Reading database
[  OK  ] DietPi-Software | Checking network connectivity
[  OK  ] DietPi-Software | Checking DNS resolver
[  OK  ] DietPi-Run_NTPD | systemctl restart systemd-timesyncd
[ INFO ] DietPi-Run_NTPD | Waiting for completion of systemd-timesyncd (1/60)
[ INFO ] DietPi-Run_NTPD | Waiting for completion of systemd-timesyncd (2/60)
[ INFO ] DietPi-Run_NTPD | Waiting for completion of systemd-timesyncd (3/60)
[ INFO ] DietPi-Run_NTPD | Waiting for completion of systemd-timesyncd (4/60)
[ INFO ] DietPi-Run_NTPD | Waiting for completion of systemd-timesyncd (5/60)

So the service is now running, but I’m still seeing the same errors. Rebooting afterwards also has the same timeout.

Other than the annoyance of waiting for it to time out, the server seems to function (though I’m having another issue with SABnzbd not being able to write to files it created, which I’m working on that I don’t think is related). So I’m not too sure if I should just accept and ignore it, as once everything is setup, I’ll not have to reboot or change configs too often.

as I said, you can disable the time sync if not needed as you use VBoxService