This commit is contained in:
Andrei Smaliak 2026-06-10 08:44:56 +04:00
parent e915a950cf
commit 2033491069
1 changed files with 12 additions and 3 deletions

View File

@ -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 6: NTP (use systemd-timesyncd, remove ntp/ntpd)
# ------------------------- # -------------------------
step "Time sync: install+enable systemd-timesyncd; remove ntp/ntpd if present" 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 ntp
systemctl_disable_now_safe ntpd systemctl_disable_now_safe ntpd
systemctl_mask_safe ntp.service systemctl_mask_safe ntp.service
apt_remove_if_installed ntp apt_remove_if_installed ntp
systemctl_enable_now_safe systemd-timesyncd if package_installed systemd-timesyncd; then
soft_run "timedatectl set-ntp true" 10 /bin/bash -lc 'timedatectl set-ntp true 2>/dev/null || true' 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 # Step 7: Production users & hardening vendor user