From b2294eae1b45aba0965d91fac694849939d6d12b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 9 Jul 2019 08:22:57 +0200 Subject: [PATCH] firewall: pflog is doing strange things lately Try to reload in case it can't open syslog and keep fully reloading it to make sure that it stays operational. --- src/etc/inc/filter.inc | 12 ++++++------ src/www/system_general.php | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/etc/inc/filter.inc b/src/etc/inc/filter.inc index 2b7ccb926..2b57eff69 100644 --- a/src/etc/inc/filter.inc +++ b/src/etc/inc/filter.inc @@ -97,15 +97,15 @@ function filter_rules_sort() function filter_pflog_start($verbose = false) { - if (isvalidpid('/var/run/filterlog.pid')) { - return; - } - if ($verbose) { echo 'Starting PFLOG...'; flush(); } + if (isvalidpid('/var/run/filterlog.pid')) { + killbypid('/var/run/filterlog.pid', 'TERM', true); + } + mwexec('/usr/local/sbin/filterlog -i pflog0 -p /var/run/filterlog.pid'); if ($verbose) { @@ -281,8 +281,6 @@ function filter_configure_sync($verbose = false, $flush_states = false, $load_al } } - filter_pflog_start($verbose); - if ($verbose) { echo 'Configuring firewall.'; flush(); @@ -514,6 +512,8 @@ function filter_configure_sync($verbose = false, $flush_states = false, $load_al echo "done.\n"; } + filter_pflog_start($verbose); + unlock($filterlck); } diff --git a/src/www/system_general.php b/src/www/system_general.php index bd18dceaf..320cbbc1a 100644 --- a/src/www/system_general.php +++ b/src/www/system_general.php @@ -217,7 +217,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { /* time zone change first */ system_timezone_configure(); - filter_pflog_start(); prefer_ipv4_or_ipv6(); system_hostname_configure(); system_hosts_generate();