[Firehol-devs] [PATCH] Silence nfacct warning when accounting not used

Phil Whineray phil at sanewall.org
Sat Jan 3 09:55:57 GMT 2015


Hi Costa

Your last commit causes warnings on my systems for a feature I do not
use - are you OK if I change the warnings to occur when accouting
statements are used, rather than at startup?

Cheers
Phil

---
 sbin/firehol.in |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/sbin/firehol.in b/sbin/firehol.in
index 2ebd862..bdfe6ef 100755
--- a/sbin/firehol.in
+++ b/sbin/firehol.in
@@ -219,13 +219,7 @@ which_cmd UNIQ_CMD uniq
 which_cmd LOGGER_CMD logger
 which_cmd FLOCK_CMD flock
 
-ENABLE_ACCOUNTING=1
 require_cmd -n nfacct
-if [ -z "${NFACCT_CMD}" ]
-then
-	echo >&2 " WARNING: no nfacct command: Accounting disabled"
-	ENABLE_ACCOUNTING=0
-fi
 
 ENABLE_IPV4=1
 require_cmd -n iptables
@@ -5801,10 +5795,12 @@ rule() {
 				;;
 
 			acct|accounting)
-				if [ ${ENABLE_ACCOUNTING} -eq 1 ]
+				if [ "${NFACCT_CMD}" ]
 				then
 					local accounting="$2"
 					FIREHOL_NFACCT[$accounting]="1"
+				else
+					softwarning "no nfacct command: Accounting disabled"
 				fi
 				shift 2
 				;;
-- 
1.7.10.4




More information about the Firehol-devs mailing list