summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/filter.inc3
-rw-r--r--etc/inc/globals.inc1
-rw-r--r--etc/inc/gwlb.inc4
-rw-r--r--etc/inc/interfaces.inc2
-rw-r--r--etc/inc/openvpn.inc2
-rw-r--r--etc/inc/pfsense-utils.inc6
-rw-r--r--etc/inc/util.inc34
7 files changed, 40 insertions, 12 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 076a828..89a3d49 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -136,8 +136,7 @@ function filter_configure() {
$mt = microtime();
echo "filter_configure() being called $mt\n";
}
- global $g;
- touch($g['tmp_path'] . "/filter_dirty");
+ send_event("filter reload");
}
function filter_delete_states_for_down_gateways() {
diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc
index a0b9f31..1b786bd 100644
--- a/etc/inc/globals.inc
+++ b/etc/inc/globals.inc
@@ -58,6 +58,7 @@ function get_nics_with_capabilities($CAPABILITIES) {
$g = array(
"base_packages" => "siproxd",
+ "event_address" => "unix:///var/run/check_reload_status",
"factory_shipped_username" => "admin",
"factory_shipped_password" => "pfsense",
"upload_path" => "/root",
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 848a62c..4235145 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -82,8 +82,8 @@ rrd interval 60s;
## These parameters can be overriden in a specific alarm configuration
alarm default {
- command on "/usr/bin/touch /tmp/filter_dirty"
- command off "/usr/bin/touch /tmp/filter_dirty"
+ command on "/usr/local/sbin/pfSctl -c 'filter reload'"
+ command off "/usr/local/sbin/pfSctl -c 'filter reload'"
combine 10s
}
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 6705a52..94903ce 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -848,7 +848,7 @@ function interface_bring_down($interface = "wan", $destroy = false) {
}
unlink_if_exists("{$g['varetc_path']}/mpd_{$interface}.conf");
if (isset($ppp['ondemand']) && !$destroy)
- file_put_contents("{$g['tmp_path']}/interface_configure", $interface);
+ send_event("interface reconfigure {$interface}");
break;
}
}
diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc
index f7765b1..6d400db 100644
--- a/etc/inc/openvpn.inc
+++ b/etc/inc/openvpn.inc
@@ -573,7 +573,7 @@ function openvpn_restart($mode, & $settings) {
/* start the new process */
$fpath = $g['varetc_path']."/openvpn/{$mode_id}.conf";
mwexec_bg("nohup openvpn --config {$fpath}");
- touch("{$g['tmp_path']}/filter_dirty");
+ send_event("filter reload");
}
function openvpn_delete($mode, & $settings) {
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index a7e25ca..0498b2e 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -852,7 +852,7 @@ function reload_interfaces_sync() {
******/
function reload_all() {
global $g;
- touch("{$g['tmp_path']}/reload_all");
+ send_event("service reload all");
}
/****f* pfsense-utils/reload_interfaces
@@ -925,10 +925,10 @@ function reload_all_sync() {
conf_mount_ro();
/* restart sshd */
- @touch("{$g['tmp_path']}/start_sshd");
+ send_event("service restart sshd");
/* restart webConfigurator if needed */
- touch("{$g['tmp_path']}/restart_webgui");
+ send_event("service restart webgui");
mwexec("/bin/rm {$g['tmp_path']}/reload*");
}
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 96d10f5..30f4566 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -137,6 +137,36 @@ function unlock($cfglckkey = 0) {
return;
}
+function send_event($cmd) {
+ global $g;
+
+ $fd = fsockopen($g['event_address']);
+ if ($fd) {
+ fwrite($fd, $cmd);
+ $resp = fread($fd, 4096);
+ if ($resp != "OK\n")
+ log_error("send_event: sent {$cmd} got {$resp}");
+ fclose($fd);
+ }
+}
+
+function send_multiple_events($cmds) {
+ global $g;
+
+ if (!is_array($cmds))
+ return;
+ $fd = fsockopen($g['event_address']);
+ if ($fd) {
+ foreach ($cmds as $cmd) {
+ fwrite($fd, $cmd);
+ $resp = fread($fd, 4096);
+ if ($resp != "OK\n")
+ log_error("send_event: sent {$cmd} got {$resp}");
+ }
+ fclose($fd);
+ }
+}
+
function refcount_init($reference) {
$shmid = shmop_open($reference, "c", 0644, 10);
shmop_write($shmid, 0, 0);
@@ -1176,8 +1206,6 @@ function start_devd() {
exec("/sbin/devd");
sleep(1);
- if(file_exists("{$g['tmp_path']}/rc.linkup"))
- unlink("{$g['tmp_path']}/rc.linkup");
}
function is_interface_mismatch() {
@@ -1207,7 +1235,7 @@ function is_interface_mismatch() {
/* sync carp entries to other firewalls */
function carp_sync_client() {
global $g;
- touch($g['tmp_path'] . "/filter_sync");
+ send_event("filter sync");
}
/****f* util/isAjax
OpenPOWER on IntegriCloud