mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
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.)
This commit is contained in:
parent
4566dcdd94
commit
8fe38524d5
@ -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();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user