summaryrefslogtreecommitdiffstats
path: root/etc/inc/system.inc
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2015-02-17 22:30:55 -0600
committerChris Buechler <cmb@pfsense.org>2015-02-17 22:32:14 -0600
commitcfda8861b93ef0a2daf2cc9ca2424200e45dd84f (patch)
tree1cdcf85a3d077a1de2e6fb8dea10823085a17573 /etc/inc/system.inc
parentcc94ea5019d6d718b57f428ce92d3959571c55c2 (diff)
downloadpfsense-cfda8861b93ef0a2daf2cc9ca2424200e45dd84f.zip
pfsense-cfda8861b93ef0a2daf2cc9ca2424200e45dd84f.tar.gz
Wait a bit after sending a TERM to syslogd as in some instances it can take too long to stop, and it fails to restart because it's still running at that point. Add a KILL in case it's still running after that. Ticket #4393
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r--etc/inc/system.inc11
1 files changed, 10 insertions, 1 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 3f81e0e..75fba5e 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -906,8 +906,17 @@ EOD;
$syslogd_extra = "-f {$g['varetc_path']}/syslog.conf {$sourceip}";
}
- if (isvalidpid("{$g['varrun_path']}/syslog.pid"))
+ if (isvalidpid("{$g['varrun_path']}/syslog.pid")) {
sigkillbypid("{$g['varrun_path']}/syslog.pid", "TERM");
+ usleep(100000); // syslogd often doesn't respond to a TERM quickly enough for the starting of syslogd below to be successful
+ }
+
+ if (isvalidpid("{$g['varrun_path']}/syslog.pid")) {
+ // if it still hasn't responded to the TERM, KILL it.
+ sigkillbypid("{$g['varrun_path']}/syslog.pid", "KILL");
+ usleep(100000);
+ }
+
$retval = mwexec_bg("/usr/sbin/syslogd -s -c -c -l {$g['dhcpd_chroot_path']}/var/run/log -P {$g['varrun_path']}/syslog.pid {$syslogd_extra}");
OpenPOWER on IntegriCloud