ports/146571: [patch] mail/spamd -- let obspamlogd manage its own pflog i/f

olli hauer ohauer at gmx.de
Fri May 14 11:40:08 UTC 2010


The following reply was made to PR ports/146571; it has been noted by GNATS.

From: olli hauer <ohauer at gmx.de>
To: bug-followup at FreeBSD.org, 
 Matthew Seaman <m.seaman at infracaninophile.co.uk>
Cc: Olli Hauer <ohauer at gmx.de>
Subject: Re: ports/146571: [patch] mail/spamd -- let obspamlogd manage its
 own pflog i/f
Date: Fri, 14 May 2010 13:30:40 +0200

 Hi Matthew,
 
 please test the modified patch.
 
 In your original patch the 'if [ -n' does not work as expected
 if 'obspamlogd_pflog_if' is not defined, even obspamlogd
 does not start on my test machine.
 
 
 # ifconfig | grep pflog
 pflog0: flags=0<> metric 0 mtu 33204
 
 # ./obspamlogd rcvar
 # obspamlogd
 ifconfig: interface create does not exist
 ./obspamlogd: WARNING: could not bring up
 
 # ifconfig | grep pflog
 pflog0: flags=0<> metric 0 mtu 33204
 pflog1: flags=141<UP,RUNNING,PROMISC> metric 0 mtu 33204
 
 
 
 It works if I change 'if [ -n' to 'if [ ! -z'
 
 --- patch_obspamlogd.in.txt begins here ---
 --- files/obspamlogd.in 2010/05/14 11:21:57 1.1
 +++ files/obspamlogd.in 2010/05/14 11:25:06
 @@ -15,6 +15,7 @@
   #
   # obspamlogd_enable="YES"  # Run the spamlogd(8) daemon (YES/NO).
   # obspamlogd_flags=""      # Extra flags for spamlogd(8) (if enabled).
 +# obspamlogd_pflog_if=""   # pflog Interface for spamlogd(8) to monitor
   #
   # DO NOT CHANGE THESE DEFAULT VALUES HERE
   #
 @@ -32,6 +33,21 @@
 
   obspamlogd_precmd()
   {
 +   if [ ! -z ${obspamlogd_pflog_if} ]; then
 +       # Configure i/f explicitly
 +       load_kld pflog || {
 +           warn "Unable to kldload pflog module"
 +           return 1
 +       }
 +
 +       if ! ifconfig ${obspamlogd_pflog_if} create up ; then
 +           warn "could not bring up ${obspamlogd_pflog_if}"
 +           return 1
 +       fi
 +
 +       rc_flags="${rc_flags} -l ${obspamlogd_pflog_if}"
 +    fi
 +
      _rc=0
      /sbin/mount -p | grep 'fdescfs.*/dev/fd.*fdescfs.*rw' 2>&1 > /dev/null
      _rc=${?}
 @@ -48,6 +64,9 @@
 
   obspamlogd_cleanup()
   {
 +   if [ ! -z ${obspamlogd_pflog_if} ]; then
 +       ifconfig ${obspamlogd_pflog_if} destroy
 +   fi
      /bin/rm -f ${pidfile}
   }
 --- patch_obspamlogd.in.txt ends here ---



More information about the freebsd-ports-bugs mailing list