Browse Source

Merge branch 'fix/915_ntp-timesyncd' into staging/fixes

Kristan Kenney 5 years ago
parent
commit
80478e5b2c
2 changed files with 9 additions and 25 deletions
  1. 5 13
      install/hst-install-debian.sh
  2. 4 12
      install/hst-install-ubuntu.sh

+ 5 - 13
install/hst-install-debian.sh

@@ -41,7 +41,7 @@ if [ "$release" -eq 9 ]; then
         dovecot-pop3d roundcube-core net-tools roundcube-mysql roundcube-plugins
         dovecot-pop3d roundcube-core net-tools roundcube-mysql roundcube-plugins
         mariadb-client mariadb-common mariadb-server postgresql
         mariadb-client mariadb-common mariadb-server postgresql
         postgresql-contrib phppgadmin phpmyadmin mc flex whois rssh git idn zip
         postgresql-contrib phppgadmin phpmyadmin mc flex whois rssh git idn zip
-        sudo bc ftp lsof ntpdate rrdtool quota e2fslibs bsdutils e2fsprogs curl
+        sudo bc ftp lsof rrdtool quota e2fslibs bsdutils e2fsprogs curl
         imagemagick fail2ban dnsutils bsdmainutils cron hestia hestia-nginx
         imagemagick fail2ban dnsutils bsdmainutils cron hestia hestia-nginx
         hestia-php expect libmail-dkim-perl unrar-free vim-common acl sysstat
         hestia-php expect libmail-dkim-perl unrar-free vim-common acl sysstat
         rsyslog ssh setpriv ipset libapache2-mod-ruid2"
         rsyslog ssh setpriv ipset libapache2-mod-ruid2"
@@ -57,7 +57,7 @@ elif [ "$release" -eq 10 ]; then
         clamav-daemon spamassassin dovecot-imapd dovecot-pop3d roundcube-core
         clamav-daemon spamassassin dovecot-imapd dovecot-pop3d roundcube-core
         net-tools roundcube-mysql roundcube-plugins mariadb-client
         net-tools roundcube-mysql roundcube-plugins mariadb-client
         mariadb-common mariadb-server postgresql postgresql-contrib phpmyadmin
         mariadb-common mariadb-server postgresql postgresql-contrib phpmyadmin
-        phppgadmin mc flex whois git idn zip sudo bc ftp lsof ntpdate rrdtool
+        phppgadmin mc flex whois git idn zip sudo bc ftp lsof rrdtool
         quota e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
         quota e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils
         bsdmainutils cron hestia hestia-nginx hestia-php expect
         bsdmainutils cron hestia hestia-nginx hestia-php expect
         libmail-dkim-perl unrar-free vim-common acl sysstat rsyslog ssh util-linux
         libmail-dkim-perl unrar-free vim-common acl sysstat rsyslog ssh util-linux
@@ -310,13 +310,6 @@ apt-get -qq update
 # Creating backup directory
 # Creating backup directory
 mkdir -p $hst_backups
 mkdir -p $hst_backups
 
 
-# Checking ntpdate
-if [ ! -e '/usr/sbin/ntpdate' ]; then
-    echo "[ * ] Installing ntpdate..."
-    apt-get -y install ntpdate >> $LOG
-    check_result $? "Can't install ntpdate"
-fi
-
 # Checking wget
 # Checking wget
 if [ ! -e '/usr/bin/wget' ]; then
 if [ ! -e '/usr/bin/wget' ]; then
     echo "[ * ] Installing wget..."
     echo "[ * ] Installing wget..."
@@ -965,10 +958,9 @@ if [ -z "$(grep ^/usr/sbin/nologin /etc/shells)" ]; then
 fi
 fi
 
 
 # Configuring NTP
 # Configuring NTP
-echo '#!/bin/sh' > /etc/cron.daily/ntpdate
-echo "$(which ntpdate) -s pool.ntp.org" >> /etc/cron.daily/ntpdate
-chmod 755 /etc/cron.daily/ntpdate
-ntpdate -s pool.ntp.org
+sed -i 's/#NTP=/NTP=pool.ntp.org/' /etc/systemd/timesyncd.conf
+systemctl enable systemd-timesyncd
+systemctl start systemd-timesyncd
 
 
 # Setup rssh
 # Setup rssh
 if [ ! "$release" -eq 10 ]; then
 if [ ! "$release" -eq 10 ]; then

+ 4 - 12
install/hst-install-ubuntu.sh

@@ -35,7 +35,7 @@ software="apache2 apache2.2-common apache2-suexec-custom apache2-utils
     cron curl dnsutils dovecot-imapd dovecot-pop3d e2fslibs e2fsprogs exim4
     cron curl dnsutils dovecot-imapd dovecot-pop3d e2fslibs e2fsprogs exim4
     exim4-daemon-heavy expect fail2ban flex ftp git idn imagemagick
     exim4-daemon-heavy expect fail2ban flex ftp git idn imagemagick
     libapache2-mod-fcgid libapache2-mod-php$fpm_v libapache2-mod-rpaf
     libapache2-mod-fcgid libapache2-mod-php$fpm_v libapache2-mod-rpaf
-    lsof mc mariadb-client mariadb-common mariadb-server nginx ntpdate
+    lsof mc mariadb-client mariadb-common mariadb-server nginx
     php$fpm_v php$fpm_v-cgi php$fpm_v-common php$fpm_v-curl phpmyadmin
     php$fpm_v php$fpm_v-cgi php$fpm_v-common php$fpm_v-curl phpmyadmin
     php$fpm_v-mysql php$fpm_v-imap php$fpm_v-ldap php$fpm_v-apcu phppgadmin
     php$fpm_v-mysql php$fpm_v-imap php$fpm_v-ldap php$fpm_v-apcu phppgadmin
     php$fpm_v-pgsql php$fpm_v-zip php$fpm_v-bz2 php$fpm_v-cli php$fpm_v-gd
     php$fpm_v-pgsql php$fpm_v-zip php$fpm_v-bz2 php$fpm_v-cli php$fpm_v-gd
@@ -292,13 +292,6 @@ apt-get -qq update
 # Creating backup directory
 # Creating backup directory
 mkdir -p $hst_backups
 mkdir -p $hst_backups
 
 
-# Checking ntpdate
-if [ ! -e '/usr/sbin/ntpdate' ]; then
-    echo "[ * ] Installing ntpdate..."
-    apt-get -y install ntpdate >> $LOG
-    check_result $? "Can't install ntpdate"
-fi
-
 # Checking wget
 # Checking wget
 if [ ! -e '/usr/bin/wget' ]; then
 if [ ! -e '/usr/bin/wget' ]; then
     echo "[ * ] Installing wget..."
     echo "[ * ] Installing wget..."
@@ -959,10 +952,9 @@ if [ -z "$(grep nologin /etc/shells)" ]; then
 fi
 fi
 
 
 # Configuring NTP
 # Configuring NTP
-echo '#!/bin/sh' > /etc/cron.daily/ntpdate
-echo "$(which ntpdate) -s pool.ntp.org" >> /etc/cron.daily/ntpdate
-chmod 755 /etc/cron.daily/ntpdate
-ntpdate -s pool.ntp.org
+sed -i 's/#NTP=/NTP=pool.ntp.org/' /etc/systemd/timesyncd.conf
+systemctl enable systemd-timesyncd
+systemctl start systemd-timesyncd
 
 
 # Setup rssh
 # Setup rssh
 if [ "$release" != '20.04' ]; then
 if [ "$release" != '20.04' ]; then