summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorsullrich <sullrich@pfsense.org>2009-12-02 23:51:33 -0500
committersullrich <sullrich@pfsense.org>2009-12-02 23:51:33 -0500
commit97733a2763a039359044b085d37e561d1c84d9f6 (patch)
treed0459140f0a57c481a5b89faa501c12058f72551 /etc/inc
parent375f7bbef4ec19c191f3181f2340a3ff67ed4cc7 (diff)
downloadpfsense-97733a2763a039359044b085d37e561d1c84d9f6.zip
pfsense-97733a2763a039359044b085d37e561d1c84d9f6.tar.gz
Ensure process is running before killing
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/config.inc3
-rw-r--r--etc/inc/pfsense-utils.inc6
-rw-r--r--etc/inc/pkg-utils.inc3
-rw-r--r--etc/inc/service-utils.inc6
-rw-r--r--etc/inc/vpn.inc6
-rw-r--r--etc/inc/vslb.inc6
6 files changed, 20 insertions, 10 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index b778ab4..fb3c46e 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -1607,7 +1607,8 @@ function system_start_ftp_helpers() {
require_once("interfaces.inc");
global $config, $g;
- mwexec("/usr/bin/killall ftpsesame", true);
+ if(is_process_running("ftpsesame"))
+ mwexec("/usr/bin/killall ftpsesame", true);
/* build an array of interfaces to work with */
$iflist = array("lan" => "lan");
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 6a43b71..38fccd5 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1881,7 +1881,8 @@ function WakeOnLan($addr, $mac)
* NOTE: this command takes 5 seconds to run
*/
function gather_altq_queue_stats($dont_return_root_queues) {
- mwexec("/usr/bin/killall -9 pfctl", true);
+ if(is_process_running("pfctl"))
+ mwexec("/usr/bin/killall -9 pfctl", true);
$stats = `/sbin/pfctl -vvsq & /bin/sleep 5;/usr/bin/killall pfctl 2>/dev/null`;
$stats_array = split("\n", $stats);
$queue_stats = array();
@@ -3416,7 +3417,8 @@ function enable_rrd_graphing() {
}
function kill_traffic_collector() {
- mwexec("/usr/bin/killall -9 rrdtool");
+ if(is_process_running("rrdtool"))
+ mwexec("/usr/bin/killall -9 rrdtool");
mwexec("ps awwwux | grep '/[u]pdaterrd.sh' | awk '{print $2}' | xargs kill -9");
}
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index 370d8f5..89c1e34 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -549,7 +549,8 @@ function install_package_xml($pkg) {
mwexec("/usr/sbin/clog -i -s 32768 {$g['varlog_path']}/{$pkg_info['logging']['logfilename']}");
chmod($g['varlog_path'] . '/' . $pkg_info['logging']['logfilename'], 0600);
@fwrite($fd_log, "Adding text to file /etc/syslog.conf\n");
- mwexec("killall syslogd");
+ if(is_process_running("syslogd"))
+ mwexec("killall syslogd");
system_syslogd_start();
}
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc
index 436926d..e9e2796 100644
--- a/etc/inc/service-utils.inc
+++ b/etc/inc/service-utils.inc
@@ -110,7 +110,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;
@@ -118,7 +119,8 @@ function stop_service($name) {
}
}
/* finally if we get here lets simply kill the service name */
- mwexec_bg("/usr/bin/killall {$name}");
+ if(is_process_running($name))
+ mwexec_bg("/usr/bin/killall {$name}");
}
function restart_service($name) {
diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc
index 91e4951..719edd2 100644
--- a/etc/inc/vpn.inc
+++ b/etc/inc/vpn.inc
@@ -71,7 +71,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"); */
@@ -1145,7 +1146,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);
diff --git a/etc/inc/vslb.inc b/etc/inc/vslb.inc
index 8792386..ac1bd4d 100644
--- a/etc/inc/vslb.inc
+++ b/etc/inc/vslb.inc
@@ -199,12 +199,14 @@ EOD;
if($should_start == 1) {
fwrite($fd, $slbdconf);
fclose($fd);
- mwexec("/usr/bin/killall -9 slbd", true);
+ if(is_process_running("slbd"))
+ mwexec("/usr/bin/killall -9 slbd", true);
sleep(2);
/* startup slbd pointing it's config at /var/etc/slbd.conf with a polling interval of 5 seconds */
mwexec("/usr/local/sbin/slbd -c{$g['varetc_path']}/slbd.conf -r5000");
} else {
- mwexec("/usr/bin/killall -9 slbd", true);
+ if(is_process_running("slbd"))
+ mwexec("/usr/bin/killall -9 slbd", true);
fclose($fd);
}
OpenPOWER on IntegriCloud