time
This commit is contained in:
parent
e915a950cf
commit
2033491069
|
|
@ -812,13 +812,22 @@ soft_run "dpkg-reconfigure tzdata" 120 /usr/sbin/dpkg-reconfigure -f noninteract
|
|||
# Step 6: NTP (use systemd-timesyncd, remove ntp/ntpd)
|
||||
# -------------------------
|
||||
step "Time sync: install+enable systemd-timesyncd; remove ntp/ntpd if present"
|
||||
apt_install_missing systemd-timesyncd
|
||||
if apt_install_missing systemd-timesyncd; then
|
||||
log "systemd-timesyncd package ensured"
|
||||
else
|
||||
log "WARN: systemd-timesyncd install failed; continuing without blocking stage_env"
|
||||
echo "[!] WARN: systemd-timesyncd install failed; continuing without it (see $LOG)"
|
||||
fi
|
||||
systemctl_disable_now_safe ntp
|
||||
systemctl_disable_now_safe ntpd
|
||||
systemctl_mask_safe ntp.service
|
||||
apt_remove_if_installed ntp
|
||||
if package_installed systemd-timesyncd; then
|
||||
systemctl_enable_now_safe systemd-timesyncd
|
||||
soft_run "timedatectl set-ntp true" 10 /bin/bash -lc 'timedatectl set-ntp true 2>/dev/null || true'
|
||||
else
|
||||
log "WARN: systemd-timesyncd is not installed; skipped timedatectl NTP enable"
|
||||
fi
|
||||
|
||||
# -------------------------
|
||||
# Step 7: Production users & hardening vendor user
|
||||
|
|
|
|||
Loading…
Reference in New Issue