diff options
author | Simon Rettberg | 2023-01-24 15:33:38 +0100 |
---|---|---|
committer | Simon Rettberg | 2023-01-24 15:33:38 +0100 |
commit | 6eaaa711ad729b3cc244f0c97e4f901172db84f0 (patch) | |
tree | 54ac3c1f959c87be3d04e1dfcbf446e6ab3468ca | |
parent | Accidentally enabled NFS (diff) | |
download | systemd-init-6eaaa711ad729b3cc244f0c97e4f901172db84f0.tar.gz systemd-init-6eaaa711ad729b3cc244f0c97e4f901172db84f0.tar.xz systemd-init-6eaaa711ad729b3cc244f0c97e4f901172db84f0.zip |
[slx-clock] Use ntpd, as ntpdate uses ntpdig, which is written in python
We don't want python in our init, it's bloated enough already...
-rwxr-xr-x | modules.d/slx-clock/module-setup.sh | 4 | ||||
-rwxr-xr-x | modules.d/slx-clock/scripts/ntp-sync.sh | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/modules.d/slx-clock/module-setup.sh b/modules.d/slx-clock/module-setup.sh index 8dbce9f1..12533363 100755 --- a/modules.d/slx-clock/module-setup.sh +++ b/modules.d/slx-clock/module-setup.sh @@ -14,9 +14,7 @@ depends() { install() { # wait til we have the openslx config for ntp servers # which happens in pre-mount/10 - inst_multiple ntpdate /etc/services /usr/share/zoneinfo/Europe/Berlin - # Needed on newer systems, where ntpdate is just a wrapper around it - inst_multiple -o ntpdig + inst_multiple /etc/services /usr/share/zoneinfo/Europe/Berlin inst /usr/share/zoneinfo/Europe/Berlin /etc/localtime inst_hook pre-mount 15 "$moddir/scripts/ntp-sync.sh" inst_hook pre-pivot 15 "$moddir/scripts/configure-timesyncd.sh" diff --git a/modules.d/slx-clock/scripts/ntp-sync.sh b/modules.d/slx-clock/scripts/ntp-sync.sh index d9c0e7bc..81b4b5a3 100755 --- a/modules.d/slx-clock/scripts/ntp-sync.sh +++ b/modules.d/slx-clock/scripts/ntp-sync.sh @@ -12,7 +12,7 @@ ntp_sync() { done local SUCCESS= for SERVER in $SLX_DHCP_NTP; do - if ntpdate -u "$SERVER"; then + if timeout 3 ntpd -q -n -p "$SERVER"; then echo "Successfully queried $SERVER for time." if [ "x$SLX_BIOS_CLOCK" = "xlocal" ]; then usleep 100000 |