Browse Source

Installer fixes: Prevent cron service restart flood

Kristan Kenney 6 years ago
parent
commit
7be9f55876
2 changed files with 11 additions and 5 deletions
  1. 6 3
      install/hst-install-debian.sh
  2. 5 2
      install/hst-install-ubuntu.sh

+ 6 - 3
install/hst-install-debian.sh

@@ -1775,6 +1775,9 @@ fi
 $HESTIA/bin/v-add-web-domain admin $servername
 check_result $? "can't create $servername domain"
 
+# Enable automatic updates
+$HESTIA/bin/v-add-cron-hestia-autoupdate
+
 # Adding cron jobs
 command="sudo $HESTIA/bin/v-update-sys-queue disk"
 $HESTIA/bin/v-add-cron-job 'admin' '15' '02' '*' '*' '*' "$command"
@@ -1791,9 +1794,9 @@ $HESTIA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command"
 command="sudo $HESTIA/bin/v-update-sys-rrd"
 $HESTIA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command"
 
-# Enable automatic updates
-$HESTIA/bin/v-add-cron-hestia-autoupdate
-service cron restart
+# Wait before restarting cron to prevent service flooding
+sleep 5
+service restart cron
 
 # Building initital rrd images
 $HESTIA/bin/v-update-sys-rrd

+ 5 - 2
install/hst-install-ubuntu.sh

@@ -1670,6 +1670,9 @@ fi
 $HESTIA/bin/v-add-web-domain admin $servername
 check_result $? "can't create $servername domain"
 
+# Enable automatic updates
+$HESTIA/bin/v-add-cron-hestia-autoupdate
+
 # Adding cron jobs
 command="sudo $HESTIA/bin/v-update-sys-queue disk"
 $HESTIA/bin/v-add-cron-job 'admin' '15' '02' '*' '*' '*' "$command"
@@ -1686,8 +1689,8 @@ $HESTIA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command"
 command="sudo $HESTIA/bin/v-update-sys-rrd"
 $HESTIA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command"
 
-# Enable automatic updates
-$HESTIA/bin/v-add-cron-hestia-autoupdate
+# Wait before restarting cron to prevent service flooding
+sleep 5
 systemctl restart cron
 
 # Building initital rrd images