It's not perfect, but at least it's functional!
Here's the main long-running service:
[Unit]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
After=network-online.target ntp-oneshot.service
[Service]
ExecStart=/usr/sbin/ntpd -n -x -g -u ntp:ntp -c /etc/ntp.conf
Type=simple
[Install]
WantedBy=multi-user.target
[Unit]
Description=NTP Daemon
After=network-online.target
[Service]
ExecStart=/usr/sbin/ntpd -q -g -x -u ntp:ntp -c /etc/ntp.conf
Type=oneshot
[Install]
WantedBy=multi-user.target
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