Browse Source

check for systemd-timesyncd (#4485)

* check for systemd-timesyncd
Maksim Usmanov | Maks 1 year ago
parent
commit
702695758f
1 changed files with 8 additions and 4 deletions
  1. 8 4
      install/hst-install-debian.sh

+ 8 - 4
install/hst-install-debian.sh

@@ -1214,10 +1214,14 @@ if [ -z "$(grep ^/usr/sbin/nologin /etc/shells)" ]; then
 fi
 
 # Configuring NTP
-if [ ! -f "/etc/default/ntpsec-ntpdate " ]; then
-	sed -i 's/#NTP=/NTP=pool.ntp.org/' /etc/systemd/timesyncd.conf
-	systemctl enable systemd-timesyncd
-	systemctl start systemd-timesyncd
+if [ ! -f "/etc/default/ntpsec-ntpdate" ]; then
+	if [ -f /etc/systemd/timesyncd.conf ]; then
+		# Not installed by default in debian 12, consider add systemd-timesyncd to
+		# package list for install
+		sed -i 's/#NTP=/NTP=pool.ntp.org/' /etc/systemd/timesyncd.conf
+		systemctl enable systemd-timesyncd
+		systemctl start systemd-timesyncd
+	fi
 fi
 # Restrict access to /proc fs
 # Prevent unpriv users from seeing each other running processes