summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2015-08-28 13:30:17 +0200
committerdoktornotor <notordoktor@gmail.com>2015-08-28 13:30:17 +0200
commit8fe38524d50a36a44f05b4cb862f3d8ff5fca16a (patch)
treed848f49a9675b30292a9a2a003a06d326f5eb21e /src
parent4566dcdd945236daee1e7d1a631c5599a3271944 (diff)
downloadpfsense-8fe38524d50a36a44f05b4cb862f3d8ff5fca16a.zip
pfsense-8fe38524d50a36a44f05b4cb862f3d8ff5fca16a.tar.gz
make sure that cron is running before reconfiguring it
This is a resubmit of #1814. (When cron goes away for whatever reason, you can keep reconfiguring it till blue in face but nothing will happen.)
Diffstat (limited to 'src')
-rw-r--r--src/etc/inc/services.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc
index c254c35..3dbc94c 100644
--- a/src/etc/inc/services.inc
+++ b/src/etc/inc/services.inc
@@ -2438,8 +2438,13 @@ function configure_cron() {
file_put_contents("/etc/crontab", $crontab_contents);
unset($crontab_contents);
+ /* make sure that cron is running and start it if it got killed somehow */
+ if (!is_process_running("cron")) {
+ exec("cd /tmp && /usr/sbin/cron -s 2>/dev/null");
+ } else {
/* do a HUP kill to force sync changes */
sigkillbypid("{$g['varrun_path']}/cron.pid", "HUP");
+ }
conf_mount_ro();
}
OpenPOWER on IntegriCloud