systemd-timesyncd.service start fails

8

3

I try to start systemd-timesyncd.service service but it fails:

root@xxxx:~# systemctl start systemd-timesyncd.service
root@xxxx:~# 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)
Condition: start condition failed at pią 2015-07-10 15:17:56 CEST; 1s ago
           ConditionFileIsExecutable=!/usr/sbin/ntpd was not met
     Docs: man:systemd-timesyncd.service(8)

What does it mean: ConditionFileIsExecutable=!/usr/sbin/ntpd was not met?
This message suggests that there is lack of execute permission, but it's not true:

root@xxxx:~# ls -l /usr/sbin/ntpd
-rwxr-xr-x 1 root root 549648 kwi 10 21:04 /usr/sbin/ntpd

patryk.beza

Posted 2015-07-10T13:28:22.020

Reputation: 1 131

1Note the exclamation mark. It’s usually used to invert true/false, though it could be something different with Systemd. – Daniel B – 2015-07-10T15:05:06.747

Answers

9

The exclamation mark negates the condition; in other words the condition that fails says: "enable if an executable file /usr/sbin/ntpd does not exist". This fails for you because /usr/bin/ntpd does exist and is executable.

The logic behind this line is that systemd-timesyncd should only be enabled if ntpd is not installed; otherwise it would be redundant (at best) or interfere with ntpd (at worst). Since you or your distribution installed ntpd, timesyncd's service file makes it back off and let ntpd be your NTP client.

If you want to tun systemd-timesyncd, you should remove ntpd. If you only want to try it out for testing, you could override the line in the service file by creating a file called /etc/systemd/system/systemd-timesyncd.service with the contents:

ConditionFileIsExecutable=

user471751

Posted 2015-07-10T13:28:22.020

Reputation:

Thanks! Removed ntp and it works now :) – Gidy – 2019-08-19T11:27:36.963

0

At first, stop and disable the ntpd daemon with one of the 2 cases below:

systemctl stop ntpd
systemctl disable ntpd

or

systemctl stop ntp
systemctl disable ntp

Denis Szalkowski

Posted 2015-07-10T13:28:22.020

Reputation: 1