diff options
-rw-r--r-- | etc/inc/service-utils.inc | 4 | ||||
-rw-r--r-- | etc/inc/system.inc | 6 | ||||
-rw-r--r-- | etc/inc/vpn.inc | 9 |
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); |