summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-01-02 18:43:19 +0000
committerErmal <eri@pfsense.org>2013-01-02 18:43:19 +0000
commit5d6495a7a4ec58d2c17b97064f82ec672428a5b6 (patch)
tree9c22ad672e80d8302ed8fd79ff2ce8debca76623 /etc
parentb08e147f433b689870206a1b98f91d716bd13c9a (diff)
downloadpfsense-5d6495a7a4ec58d2c17b97064f82ec672428a5b6.zip
pfsense-5d6495a7a4ec58d2c17b97064f82ec672428a5b6.tar.gz
Tell filterdns to reload the config rather than restart if its running
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/captiveportal.inc8
-rw-r--r--etc/inc/filter.inc16
-rw-r--r--etc/inc/vpn.inc9
3 files changed, 22 insertions, 11 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 9418c14..1fc3d73 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -1023,8 +1023,12 @@ function captiveportal_allowedhostname_configure() {
$cp_filterdns_filename = "{$g['varetc_path']}/filterdns-{$cpzone}-captiveportal.conf";
@file_put_contents($cp_filterdns_filename, $cp_filterdns_conf);
unset($cp_filterdns_conf);
- killbypid("{$g['tmp_path']}/filterdns-{$cpzone}-cpah.pid");
- mwexec("/usr/local/sbin/filterdns -p {$g['tmp_path']}/filterdns-{$cpzone}-cpah.pid -i 300 -c {$cp_filterdns_filename} -y {$cpzone} -d 1");
+ if (isvalidpid("{$g['tmp_path']}/filterdns-{$cpzone}-cpah.pid"))
+ sigkillbypid("{$g['tmp_path']}/filterdns-{$cpzone}-cpah.pid", "HUP");
+ else {
+ killbypid("{$g['tmp_path']}/filterdns-{$cpzone}-cpah.pid");
+ mwexec("/usr/local/sbin/filterdns -p {$g['tmp_path']}/filterdns-{$cpzone}-cpah.pid -i 300 -c {$cp_filterdns_filename} -y {$cpzone} -d 1");
+ }
}
return $rules;
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 6bd77d6..81d4945 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -336,13 +336,17 @@ function filter_configure_sync($delete_states_if_needed = true) {
layer7_start_l7daemon();
if(!empty($filterdns)) {
- killbypid("{$g['tmp_path']}/filterdns.pid");
@file_put_contents("{$g['varetc_path']}/filterdns.conf", $filterdns);
- /*
- * FilterDNS has three debugging levels. The default choosen is 1.
- * Availabe are level 2 and greater then 2.
- */
- mwexec("/usr/local/sbin/filterdns -p {$g['tmp_path']}/filterdns.pid -i 300 -c {$g['varetc_path']}/filterdns.conf -d 1");
+ if (isvalidpid("{$g['tmp_path']}/filterdns.pid"))
+ sigkillbypid("{$g['tmp_path']}/filterdns.pid", "HUP");
+ else {
+ killbypid("{$g['tmp_path']}/filterdns.pid");
+ /*
+ * FilterDNS has three debugging levels. The default choosen is 1.
+ * Availabe are level 2 and greater then 2.
+ */
+ mwexec("/usr/local/sbin/filterdns -p {$g['tmp_path']}/filterdns.pid -i 300 -c {$g['varetc_path']}/filterdns.conf -d 1");
+ }
}
/* run items scheduled for after filter configure run */
diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc
index 26d8bcb..f7cd290 100644
--- a/etc/inc/vpn.inc
+++ b/etc/inc/vpn.inc
@@ -977,9 +977,12 @@ EOD;
file_put_contents("{$g['varetc_path']}/ipsec/filterdns-ipsec.hosts", $hostnames);
unset($hostnames);
- killbypid("{$g['varrun_path']}/filterdns-ipsec.pid");
- sleep(1);
- mwexec("/usr/local/sbin/filterdns -p {$g['varrun_path']}/filterdns-ipsec.pid -i {$interval} -c {$g['varetc_path']}/ipsec/filterdns-ipsec.hosts -d 1");
+ if (isvalidpid("{$g['varrun_path']}/filterdns-ipsec.pid"))
+ sigkillbypid("{$g['varrun_path']}/filterdns-ipsec.pid", "HUP");
+ else {
+ killbypid("{$g['varrun_path']}/filterdns-ipsec.pid");
+ mwexec("/usr/local/sbin/filterdns -p {$g['varrun_path']}/filterdns-ipsec.pid -i {$interval} -c {$g['varetc_path']}/ipsec/filterdns-ipsec.hosts -d 1");
+ }
}
vpn_ipsec_failover_configure();
OpenPOWER on IntegriCloud