Thursday, September 12, 2013

Systemd and NTP on Gentoo

Gentoo currently doesn't have systemd support for the NTP package. So I built some to tide me over until it's officially available.

It's not perfect, but at least it's functional!

Here's the main long-running service:
Description=NTP Daemon ntp-oneshot.service

ExecStart=/usr/sbin/ntpd -n -x -g -u ntp:ntp -c /etc/ntp.conf

In case your system doesn't have a hardware clock, here's a one-shot service that will override the systemclock to match the value of the network time.
Description=NTP Daemon

ExecStart=/usr/sbin/ntpd -q -g -x -u ntp:ntp -c /etc/ntp.conf


Don't forget to tell systemd-timedated about your ntp service
#echo "ntpd.service" > /usr/lib/systemd/ntp-units.d/60-ntpd.list
#systemctl enable ntpd.service && systemctl start ntpd.service

No comments:

Post a Comment