aboutsummaryrefslogtreecommitdiffstats
path: root/30-timesyncd
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2016-09-20 13:48:04 +0200
committerGravatar Christian Hesse <mail@eworm.de>2016-09-20 13:48:04 +0200
commitb3c19f9ad1853db207c498d4120d9466f5404076 (patch)
tree7c17021acce0c3d05c839fb54d84f4fe87493196 /30-timesyncd
parent09ea6a0778a0e095f89925396338c72f1881ebfd (diff)
downloadnetworkmanager-dispatcher-timesyncd-b3c19f9ad1853db207c498d4120d9466f5404076.tar.gz
networkmanager-dispatcher-timesyncd-b3c19f9ad1853db207c498d4120d9466f5404076.tar.zst
restart systemd-timesyncd if NTP server is available
Diffstat (limited to '30-timesyncd')
-rwxr-xr-x30-timesyncd5
1 files changed, 4 insertions, 1 deletions
diff --git a/30-timesyncd b/30-timesyncd
index 2276cbb..a56652f 100755
--- a/30-timesyncd
+++ b/30-timesyncd
@@ -13,7 +13,10 @@ case "${STATUS}" in
echo "[Time]" >> /run/systemd/timesyncd.conf.d/${INTERFACE}.conf
echo "NTP = ${DHCP4_NTP_SERVERS}" >> /run/systemd/timesyncd.conf.d/${INTERFACE}.conf
- timedatectl set-ntp true
+ # systemd-timesyncd does not notice changed configuration. So if it is
+ # already running 'timedatectl set-ntp true' does not work.
+ # Restart the service instead.
+ systemctl restart systemd-timesyncd.service
fi
;;
down)