12

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
1
  • 1
    Note the exclamation mark. It’s usually used to invert true/false, though it could be something different with Systemd. – Daniel B Jul 10 '15 at 15:05
14

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=
1
  • Thanks! Removed ntp and it works now :) – Gidy Aug 19 '19 at 11:27
1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.