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

Tsaousis, Costa costa at tsaousis.gr
Sat Jan 3 12:09:55 GMT 2015


Phil, you are right.
I will fix it later today to give a warning only if accounting is actually used.
Thanks.


On Sat, Jan 3, 2015 at 11:55 AM, Phil Whineray <phil at sanewall.org> wrote:
> 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
>
> _______________________________________________
> Firehol-devs mailing list
> Firehol-devs at lists.firehol.org
> http://lists.firehol.org/mailman/listinfo/firehol-devs



More information about the Firehol-devs mailing list