summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/config.inc6
-rw-r--r--etc/inc/shaper.inc9
-rw-r--r--etc/inc/util.inc2
3 files changed, 9 insertions, 8 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index 6e9edc6..5cb7ca4 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -2834,9 +2834,9 @@ function system_start_ftp_helpers() {
if($g['debug'])
log_error("Config: FTP proxy disabled for interface {$ifent}");
- $helpers = `/bin/ps awux | grep "ftp-proxy" | grep "{$port}" | grep -v grep | awk '{ print $2 }'`;
- if($helpers)
- mwexec("/bin/kill {$helpers}");
+ exec("/bin/ps awux | grep \"ftp-proxy\" | grep \"{$port}\" | grep -v grep | awk '{ print $2 }'", $helpers);
+ if(count($helpers[0]) > 0)
+ mwexec("/bin/kill {$helpers[0]}");
$interface_counter++;
} else {
/* grab the current interface IP address */
diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc
index 4390b7e..b71b986 100644
--- a/etc/inc/shaper.inc
+++ b/etc/inc/shaper.inc
@@ -3401,10 +3401,11 @@ function layer7_start_l7daemon() {
unset($l7pid);
/* Only reread the configuration rather than restart to avoid loosing information. */
- $l7pid = `/bin/ps -ax | /usr/bin/grep ipfw-classifyd | /usr/bin/grep ". $l7rules->GetRPort() . " | /usr/bin/grep -v \"grep\" | /usr/bin/awk '{ print $1}'`;
- if (isset($l7pid))
- mwexec("/bin/kill -HUP {$l7pid}");
- else {
+ exec("/bin/ps -ax | /usr/bin/grep ipfw-classifyd | /usr/bin/grep ". $l7rules->GetRPort() . " | /usr/bin/grep -v grep | /usr/bin/awk '{ print $1}'", $l7pid);
+ if (count($l7pid) > 0) {
+ log_error("Sending HUP signal to {$l7pid[0]}");
+ mwexec("/bin/kill -HUP {$l7pid[0]}");
+ } else {
// XXX: Hardcoded number of packets to garbage collect and queue length..
$ipfw_classifyd_init = "/usr/local/sbin/ipfw-classifyd -n 5 -q 700 -c {$path} -p " . $l7rules->GetRPort() . " -P /usr/local/share/protocols";
mwexec_bg($ipfw_classifyd_init);
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index f85a672..e28c068 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -72,7 +72,7 @@ function killbyname($procname) {
}
function is_module_loaded($module_name) {
- $running = `/sbin/kldstat -n {$module_name} | /usr/bin/grep {$module_name} | /usr/bin/wc -l`;
+ $running = `/sbin/kldstat -n /boot/kernel/{$module_name} | /usr/bin/grep {$module_name} | /usr/bin/wc -l`;
if (intval($running) >= 1)
return true;
else
OpenPOWER on IntegriCloud