]> git.proxmox.com Git - pve-installer.git/commitdiff
fix #3165: start chrony after DHCP client for an opportunistic time-sync
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 26 Mar 2021 14:43:56 +0000 (15:43 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 26 Mar 2021 14:55:08 +0000 (15:55 +0100)
We had reports about problems stemming from skewed clocks during
installation, especially if their time was in the future during
installation and on first real boot got synced up, certs may not be
valid yet, RRD may has written data before that correcting time-sync
went through and errors afterwards, once time jumped back, and lots
of other issues.

So, depend on the modern and nifty, but still small, NTP
implementation `chrony`. Start its daemon just after we asked for a
DHCP lease, as then it can directly try to sync with one of the
(Debian namespaced) NTP pools time server.

In the worst case (no network, no server available) we are as good as
now, but if chrony can sync the time we avoid lots of issues and
breakages

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
debian/control
unconfigured.sh

index b03b569c0a3dbacba5624215c7fbda761833f09b..1214ae4279e86a47882718ba51e944efd8f4c5c6 100644 (file)
@@ -13,6 +13,7 @@ Homepage: https://www.proxmox.com
 Package: pve-installer
 Architecture: all
 Depends: geoip-bin,
+         chrony,
          libgtk3-webkit2-perl,
          pve-kernel-helper,
          squashfs-tools,
@@ -23,6 +24,7 @@ Description: Proxmox VE Installer
 Package: pmg-installer
 Architecture: all
 Depends: geoip-bin,
+         chrony,
          libgtk3-webkit2-perl,
          pve-kernel-helper,
          squashfs-tools,
@@ -33,6 +35,7 @@ Description: Proxmox Mail Gateway Installer
 Package: pbs-installer
 Architecture: all
 Depends: geoip-bin,
+         chrony,
          libgtk3-webkit2-perl,
          pve-kernel-helper,
          squashfs-tools,
index e36ffc982b79f7b7292e8327601bfb2853345e1b..86415ae45163085798ad80531e0422667d01bdc1 100755 (executable)
@@ -107,6 +107,9 @@ echo -n "Attempting to get DHCP leases... "
 dhclient -v
 echo "done"
 
+echo -n "Starting chrony for opportunistic time-sync... "
+chronyd || echo "starting chrony failed"
+
 echo "Starting a root shell on tty3."
 setsid /sbin/agetty -a root --noclear tty3 &