summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter_log.inc13
-rw-r--r--etc/inc/interfaces.inc13
-rwxr-xr-xetc/rc.carpbackup3
-rwxr-xr-xetc/rc.carpmaster3
4 files changed, 21 insertions, 11 deletions
diff --git a/etc/inc/filter_log.inc b/etc/inc/filter_log.inc
index d55d332..3e06058 100644
--- a/etc/inc/filter_log.inc
+++ b/etc/inc/filter_log.inc
@@ -37,7 +37,7 @@
require 'config.inc';
/* format filter logs */
-function conv_log_filter($logfile, $nentries, $tail = 50, $filtertext = "") {
+function conv_log_filter($logfile, $nentries, $tail = 50, $filtertext = "", $filterinterface = null) {
global $config, $g;
/* Make sure this is a number before using it in a system call */
@@ -63,15 +63,18 @@ function conv_log_filter($logfile, $nentries, $tail = 50, $filtertext = "") {
$counter = 0;
$logarr = array_reverse(collapse_filter_lines(array_reverse($logarr)));
-
+ $filterinterface = strtoupper($filterinterface);
foreach ($logarr as $logent) {
if($counter >= $nentries)
break;
$flent = parse_filter_line($logent);
- if (($flent != "") && (match_filter_line($flent, $filtertext))) {
- $counter++;
- $filterlog[] = $flent;
+ if (!$filterinterface || ($filterinterface == $flent['interface']))
+ {
+ if (($flent != "") && (match_filter_line($flent, $filtertext))) {
+ $counter++;
+ $filterlog[] = $flent;
+ }
}
}
/* Since the lines are in reverse order, flip them around if needed based on the user's preference */
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 3747805..551d833 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -1822,10 +1822,15 @@ function interfaces_carp_setup() {
/* XXX: Handle an issue with pfsync(4) and carp(4). In a cluster carp will come up before pfsync(4) has updated and so will cause issues
* for existing sessions.
*/
- $i = 0;
- while (intval(trim(`/sbin/ifconfig pfsync0 | /usr/bin/grep 'syncok: 0' | /usr/bin/grep -v grep | /usr/bin/wc -l`)) == 0 && $i < 30) {
- $i++;
- sleep(1);
+ if ($config['hasync']['pfsyncenabled'] === "on"){
+ echo "waiting for pfsync...";
+ $i = 0;
+ while (intval(trim(`/sbin/ifconfig pfsync0 | /usr/bin/grep 'syncok: 0' | /usr/bin/grep -v grep | /usr/bin/wc -l`)) == 0 && $i < 30) {
+ $i++;
+ sleep(1);
+ }
+ echo "pfsync done in $i seconds.\n";
+ echo "Configuring CARP settings finalize...";
}
if($config['virtualip']['vip'])
diff --git a/etc/rc.carpbackup b/etc/rc.carpbackup
index 76cdfac..d463d45 100755
--- a/etc/rc.carpbackup
+++ b/etc/rc.carpbackup
@@ -33,8 +33,9 @@ require_once("functions.inc");
require_once("config.inc");
require_once("notices.inc");
require_once("openvpn.inc");
+require_once("interfaces.inc");
-$notificationmsg = "A carp cluster member has resumed the state 'BACKUP'";
+$notificationmsg = sprintf('Carp cluster member "%2$s (%1$s)" has resumed the state "BACKUP"',$argv[1],convert_friendly_interface_to_friendly_descr($argv[1]));
notify_via_smtp($notificationmsg);
notify_via_growl($notificationmsg);
diff --git a/etc/rc.carpmaster b/etc/rc.carpmaster
index cb5395e..f57d150 100755
--- a/etc/rc.carpmaster
+++ b/etc/rc.carpmaster
@@ -33,8 +33,9 @@ require_once("functions.inc");
require_once("config.inc");
require_once("notices.inc");
require_once("openvpn.inc");
+require_once("interfaces.inc");
-$notificationmsg = "A carp cluster member has resumed the state 'MASTER'";
+$notificationmsg = sprintf('Carp cluster member "%2$s (%1$s)" has resumed the state "MASTER"',$argv[1],convert_friendly_interface_to_friendly_descr($argv[1]));
notify_via_smtp($notificationmsg);
notify_via_growl($notificationmsg);
OpenPOWER on IntegriCloud