ntpd.service change

Richard Laager rlaager at wiktel.com
Tue Mar 6 20:09:14 UTC 2018


On 03/06/2018 09:06 AM, Udo van den Heuvel wrote:
> I must look into this way of solving things as it did not work for me yet.
> I installed the default ntpd.service file.
> Then in  /etc/systemd/system/ntpd.service.d/ I created
> 10-environment.conf with contents:
> EnvironmentFile=-/etc/sysconfig/ntpd
> ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS
> 
> /etc/sysconfig/ntpd contains:
> # Command line options for ntpd
> OPTIONS="-g"
> 
> But it appears that these suggestions are not used (despite reload of
> systemd) as the -N option is still passed to ntpd.

Previously, you could not override ExecStart, only add to it. In systemd
197 (available in Fedora 18), this syntax should work:

ExecStart=
EnvironmentFile=-/etc/sysconfig/ntpd
ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS

The empty ExecStart= indicates that you are clearing out the previous
ExecStart entry (or entries, but that's not applicable here) and then
you add your replacement.

See this, especially starting at comment 9:
https://bugzilla.redhat.com/show_bug.cgi?id=756787

Note that I have not personally tested this. If this doesn't work for
you, what is your systemd version, and what is the output of `systemctl
show ntpd.service`?

-- 
Richard


More information about the devel mailing list