summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorsullrich <sullrich@pfsense.org>2009-12-02 23:25:19 -0500
committersullrich <sullrich@pfsense.org>2009-12-02 23:25:19 -0500
commit99f98b8009f7a5ce48b17c5295aad11c535610db (patch)
tree0095b1634a4434adea223a53d8cb313e6f799e0e /etc
parentcd12593b723b2f4c93d1c8f554a7e99bd66d50fa (diff)
downloadpfsense-99f98b8009f7a5ce48b17c5295aad11c535610db.zip
pfsense-99f98b8009f7a5ce48b17c5295aad11c535610db.tar.gz
Check to see if processes are running before killing
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/service-utils.inc4
-rw-r--r--etc/inc/system.inc6
-rw-r--r--etc/inc/vpn.inc9
3 files changed, 13 insertions, 6 deletions
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc
index e4e1755..0d4c1e1 100644
--- a/etc/inc/service-utils.inc
+++ b/etc/inc/service-utils.inc
@@ -115,7 +115,8 @@ function stop_service($name) {
eval($service['stopcmd']);
}
if(!($service['rcfile'] or $service['stopcmd'])) {
- mwexec_bg("/usr/bin/killall {$service['executable']}");
+ if(is_process_running("{$service['executable']}"))
+ mwexec_bg("/usr/bin/killall {$service['executable']}");
return;
}
break;
@@ -123,6 +124,7 @@ function stop_service($name) {
}
}
/* finally if we get here lets simply kill the service name */
+if(is_process_running("{$name}"))
mwexec_bg("/usr/bin/killall {$name}");
}
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 02dc675..450a0b3 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -381,8 +381,10 @@ function system_syslogd_start() {
else
killbypid("{$g['varrun_path']}/syslog.pid");
- mwexec("/usr/bin/killall -9 syslogd");
- mwexec("/usr/bin/killall -9 fifolog_writer");
+ if(is_process_running("syslogd"))
+ mwexec("/usr/bin/killall -9 syslogd");
+ if(is_process_running("fifolog_writer"))
+ mwexec("/usr/bin/killall -9 fifolog_writer");
// Define carious commands for logging
$fifolog_create = "/usr/sbin/fifolog_create -s ";
diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc
index 20caf72..9f087a9 100644
--- a/etc/inc/vpn.inc
+++ b/etc/inc/vpn.inc
@@ -72,7 +72,8 @@ function vpn_ipsec_failover_configure() {
fclose($fd);
chmod("{$g['varetc_path']}/sasyncd.conf", 0600);
- mwexec("killall sasyncd", true);
+ if(is_process_running("sasyncd"))
+ mwexec("killall sasyncd", true);
/* launch sasyncd, oh wise one */
mwexec_bg("/usr/local/sbin/sasyncd -d -v -v -v");
@@ -130,7 +131,8 @@ function vpn_ipsec_configure($ipchg = false)
mwexec("/sbin/ifconfig enc0 down");
/* kill racoon */
- mwexec("/usr/bin/killall racoon", true);
+ if(is_process_running("racoon"))
+ mwexec("/usr/bin/killall racoon", true);
killbypid("{$g['varrun_path']}/dnswatch-ipsec.pid");
/* wait for racoon process to die */
@@ -903,7 +905,8 @@ function vpn_ipsec_force_reload() {
$ipseccfg = $config['ipsec'];
/* kill racoon */
- mwexec("/usr/bin/killall racoon", true);
+ if(is_process_running("racoon"))
+ mwexec("/usr/bin/killall racoon", true);
/* wait for process to die */
sleep(4);
OpenPOWER on IntegriCloud