timesyncd service not starting. Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
CrossmenX
Posts: 13
Joined: Thu Dec 13, 2018 8:42 am

timesyncd service not starting.

Post by CrossmenX »

Hello again.

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

Code: Select all

$ 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.
User avatar
Joulinar
Posts: 2022
Joined: Sat Nov 16, 2019 12:49 am

Re: timesyncd service not starting.

Post by Joulinar »

Hi,

many thanks for your report. Pls can you post following

Code: Select all

journalctl -u systemd-timesyncd.service
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
CrossmenX
Posts: 13
Joined: Thu Dec 13, 2018 8:42 am

Re: timesyncd service not starting.

Post by CrossmenX »

Thanks Joulinar,

Here is the output requested:

Code: Select all

$ 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.
User avatar
Joulinar
Posts: 2022
Joined: Sat Nov 16, 2019 12:49 am

Re: timesyncd service not starting.

Post by Joulinar »

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

Code: Select all

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

Code: Select all

systemctl daemon-reload
systemctl restart systemd-timesyncd.service
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
CrossmenX
Posts: 13
Joined: Thu Dec 13, 2018 8:42 am

Re: timesyncd service not starting.

Post by CrossmenX »

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.
User avatar
Joulinar
Posts: 2022
Joined: Sat Nov 16, 2019 12:49 am

Re: timesyncd service not starting.

Post by Joulinar »

yes, you could disable the time sync check in dietpi if you use VBoxService
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
CrossmenX
Posts: 13
Joined: Thu Dec 13, 2018 8:42 am

Re: timesyncd service not starting.

Post by CrossmenX »

Code: Select all

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.
User avatar
Joulinar
Posts: 2022
Joined: Sat Nov 16, 2019 12:49 am

Re: timesyncd service not starting.

Post by Joulinar »

as I said, you can disable the time sync if not needed as you use VBoxService
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply