maybe chmod 0644 'dhcp/dhclient-exit-hooks.d/ntpsec-ntpdate'
maybe chmod 0755 'dhcp/dhclient-exit-hooks.d/resolved'
maybe chmod 0644 'dhcp/dhclient-exit-hooks.d/rfc3442-classless-routes'
+maybe chmod 0644 'dhcp/dhclient-exit-hooks.d/timesyncd'
maybe chmod 0755 'dhcp/dhclient-exit-hooks.d/zzz_avahi-autoipd'
maybe chmod 0644 'dhcp/dhclient.conf'
maybe chmod 0644 'dhcpcd.conf'
maybe chmod 0755 'init.d/binfmt-support'
maybe chmod 0755 'init.d/bluetooth'
maybe chmod 0755 'init.d/cgroupfs-mount'
-maybe chmod 0755 'init.d/chrony'
+maybe chmod 0644 'init.d/chrony'
maybe chmod 0755 'init.d/console-setup.sh'
maybe chmod 0755 'init.d/cron'
maybe chmod 0755 'init.d/cryptdisks'
maybe chmod 0755 'systemd/system/zfs-share.service.wants'
maybe chmod 0755 'systemd/system/zfs-volumes.target.wants'
maybe chmod 0755 'systemd/system/zfs.target.wants'
+maybe chmod 0644 'systemd/timesyncd.conf'
maybe chmod 0755 'systemd/user'
maybe chmod 0644 'systemd/user.conf'
maybe chmod 0755 'systemd/user/default.target.wants'
--- /dev/null
+TIMESYNCD_CONF=/run/systemd/timesyncd.conf.d/01-dhclient.conf
+
+timesyncd_servers_setup_remove() {
+ if [ ! -d /run/systemd/system ]; then
+ return
+ fi
+ if [ ! -x /usr/lib/systemd/systemd-timesyncd ]; then
+ return
+ fi
+
+ if [ -e $TIMESYNCD_CONF ]; then
+ rm -f $TIMESYNCD_CONF
+ systemctl try-restart systemd-timesyncd.service || true
+ fi
+}
+
+timesyncd_servers_setup_add() {
+ if [ ! -d /run/systemd/system ]; then
+ return
+ fi
+ if [ ! -x /usr/lib/systemd/systemd-timesyncd ]; then
+ return
+ fi
+
+ if [ -e $TIMESYNCD_CONF ] && [ "$new_ntp_servers" = "$old_ntp_servers" ]; then
+ return
+ fi
+
+ if [ -z "$new_ntp_servers" ]; then
+ timesyncd_servers_setup_remove
+ return
+ fi
+
+ mkdir -p $(dirname $TIMESYNCD_CONF)
+ cat <<EOF > ${TIMESYNCD_CONF}.new
+# NTP server entries received from DHCP server
+[Time]
+NTP=$new_ntp_servers
+EOF
+ mv ${TIMESYNCD_CONF}.new ${TIMESYNCD_CONF}
+ systemctl try-restart systemd-timesyncd.service || true
+}
+
+
+case $reason in
+ BOUND|RENEW|REBIND|REBOOT)
+ timesyncd_servers_setup_add
+ ;;
+ EXPIRE|FAIL|RELEASE|STOP)
+ timesyncd_servers_setup_remove
+ ;;
+esac
--- /dev/null
+/usr/lib/systemd/system/systemd-timesyncd.service
\ No newline at end of file
--- /dev/null
+/usr/lib/systemd/system/systemd-timesyncd.service
\ No newline at end of file
--- /dev/null
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it under the
+# terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation; either version 2.1 of the License, or (at your option)
+# any later version.
+#
+# Entries in this file show the compile time defaults. Local configuration
+# should be created by either modifying this file (or a copy of it placed in
+# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
+# the /etc/systemd/timesyncd.conf.d/ directory. The latter is generally
+# recommended. Defaults can be restored by simply deleting the main
+# configuration file and all drop-ins located in /etc/.
+#
+# Use 'systemd-analyze cat-config systemd/timesyncd.conf' to display the full config.
+#
+# See timesyncd.conf(5) for details.
+
+[Time]
+#NTP=
+#FallbackNTP=ntp.ubuntu.com
+#RootDistanceMaxSec=5
+#PollIntervalMinSec=32
+#PollIntervalMaxSec=2048
+#ConnectionRetrySec=30
+#SaveIntervalSec=60