diff for passing -b to spamd-setup when running spamd in blacklist only mode

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

diff for passing -b to spamd-setup when running spamd in blacklist only mode

Maurice Janssen-2
Hi,

After some discussion on misc@ (see
http://comments.gmane.org/gmane.os.openbsd.misc/209233 ) I came up
with the patch below. Right now, spamd-setup is started with -D in
/etc/rc.  However, when running spamd in blacklist only mode, I think
it's better to start spamd-setup also with -b.  Otherwise, the
<spamd> table in pf is not filled with the data from the blacklists
and spamd is effectively not operational until it is run with -b either
manually or from cron.

Maurice


Index: rc
===================================================================
RCS file: /cvs/src/etc/rc,v
retrieving revision 1.407
diff -u -p -u -r1.407 rc
--- rc  9 Aug 2013 16:24:54 -0000       1.407
+++ rc  13 Dec 2013 21:19:44 -0000
@@ -499,10 +499,6 @@ start_daemon rbootd mopd popa3d spamd sp
 start_daemon ipropd_master ipropd_slave sndiod
 echo '.'
 
-if [ X"${spamd_flags}" != X"NO" ]; then
-       /usr/libexec/spamd-setup -D
-fi
-
 # If rc.firstime exists, run it just once, and make sure it is deleted
 if [ -f /etc/rc.firsttime ]; then
        mv /etc/rc.firsttime /etc/rc.firsttime.run



Index: rc.d/spamd
===================================================================
RCS file: /cvs/src/etc/rc.d/spamd,v
retrieving revision 1.3
diff -u -p -u -r1.3 spamd
--- rc.d/spamd  13 Sep 2013 14:50:56 -0000      1.3
+++ rc.d/spamd  13 Dec 2013 21:19:44 -0000
@@ -15,4 +15,12 @@ rc_pre() {
        return 0
 }
 
+rc_start() {
+       ${rcexec} "${daemon} ${daemon_flags} ${_bg}"
+       spamd_setup_flags="-D"
+       [ X"${spamd_black}" != X"NO" ] && \
+               spamd_setup_flags="-b ${spamd_setup_flags}"
+       rc_do rc_wait start && /usr/libexec/spamd-setup ${spamd_setup_flags}
+}
+
 rc_cmd $1

Reply | Threaded
Open this post in threaded view
|

Re: diff for passing -b to spamd-setup when running spamd in blacklist only mode

Alexander Hall
On 12/13/13 22:32, Maurice Janssen wrote:

> Hi,
>
> After some discussion on misc@ (see
> http://comments.gmane.org/gmane.os.openbsd.misc/209233 ) I came up
> with the patch below. Right now, spamd-setup is started with -D in
> /etc/rc.  However, when running spamd in blacklist only mode, I think
> it's better to start spamd-setup also with -b.  Otherwise, the
> <spamd> table in pf is not filled with the data from the blacklists
> and spamd is effectively not operational until it is run with -b either
> manually or from cron.
>
> Maurice

Diff is whitespace mangled. Care to resend it?

/Alexander

>
>
> Index: rc
> ===================================================================
> RCS file: /cvs/src/etc/rc,v
> retrieving revision 1.407
> diff -u -p -u -r1.407 rc
> --- rc  9 Aug 2013 16:24:54 -0000       1.407
> +++ rc  13 Dec 2013 21:19:44 -0000
> @@ -499,10 +499,6 @@ start_daemon rbootd mopd popa3d spamd sp
>   start_daemon ipropd_master ipropd_slave sndiod
>   echo '.'
>
> -if [ X"${spamd_flags}" != X"NO" ]; then
> -       /usr/libexec/spamd-setup -D
> -fi
> -
>   # If rc.firstime exists, run it just once, and make sure it is deleted
>   if [ -f /etc/rc.firsttime ]; then
>          mv /etc/rc.firsttime /etc/rc.firsttime.run
>
>
>
> Index: rc.d/spamd
> ===================================================================
> RCS file: /cvs/src/etc/rc.d/spamd,v
> retrieving revision 1.3
> diff -u -p -u -r1.3 spamd
> --- rc.d/spamd  13 Sep 2013 14:50:56 -0000      1.3
> +++ rc.d/spamd  13 Dec 2013 21:19:44 -0000
> @@ -15,4 +15,12 @@ rc_pre() {
>          return 0
>   }
>
> +rc_start() {
> +       ${rcexec} "${daemon} ${daemon_flags} ${_bg}"
> +       spamd_setup_flags="-D"
> +       [ X"${spamd_black}" != X"NO" ] && \
> +               spamd_setup_flags="-b ${spamd_setup_flags}"
> +       rc_do rc_wait start && /usr/libexec/spamd-setup ${spamd_setup_flags}
> +}
> +
>   rc_cmd $1
>

Reply | Threaded
Open this post in threaded view
|

Re: diff for passing -b to spamd-setup when running spamd in blacklist only mode

Maurice Janssen-2
On Fri, Dec 13, 2013 at 11:53:06PM +0100, Alexander Hall wrote:

>On 12/13/13 22:32, Maurice Janssen wrote:
>>Hi,
>>
>>After some discussion on misc@ (see
>>http://comments.gmane.org/gmane.os.openbsd.misc/209233 ) I came up
>>with the patch below. Right now, spamd-setup is started with -D in
>>/etc/rc.  However, when running spamd in blacklist only mode, I think
>>it's better to start spamd-setup also with -b.  Otherwise, the
>><spamd> table in pf is not filled with the data from the blacklists
>>and spamd is effectively not operational until it is run with -b either
>>manually or from cron.
>>
>>Maurice
>
>Diff is whitespace mangled. Care to resend it?

Oops, this one should be better.

Maurice



Index: rc
===================================================================
RCS file: /cvs/src/etc/rc,v
retrieving revision 1.407
diff -u -p -u -r1.407 rc
--- rc 9 Aug 2013 16:24:54 -0000 1.407
+++ rc 14 Dec 2013 12:13:27 -0000
@@ -499,10 +499,6 @@ start_daemon rbootd mopd popa3d spamd sp
 start_daemon ipropd_master ipropd_slave sndiod
 echo '.'
 
-if [ X"${spamd_flags}" != X"NO" ]; then
- /usr/libexec/spamd-setup -D
-fi
-
 # If rc.firstime exists, run it just once, and make sure it is deleted
 if [ -f /etc/rc.firsttime ]; then
  mv /etc/rc.firsttime /etc/rc.firsttime.run
Index: rc.d/spamd
===================================================================
RCS file: /cvs/src/etc/rc.d/spamd,v
retrieving revision 1.3
diff -u -p -u -r1.3 spamd
--- rc.d/spamd 13 Sep 2013 14:50:56 -0000 1.3
+++ rc.d/spamd 14 Dec 2013 12:13:27 -0000
@@ -15,4 +15,12 @@ rc_pre() {
  return 0
 }
 
+rc_start() {
+ ${rcexec} "${daemon} ${daemon_flags} ${_bg}"
+ spamd_setup_flags="-D"
+ [ X"${spamd_black}" != X"NO" ] && \
+ spamd_setup_flags="-b ${spamd_setup_flags}"
+ rc_do rc_wait start && /usr/libexec/spamd-setup ${spamd_setup_flags}
+}
+
 rc_cmd $1

Reply | Threaded
Open this post in threaded view
|

Re: diff for passing -b to spamd-setup when running spamd in blacklist only mode

Alexander Hall
On 12/14/13 13:15, Maurice Janssen wrote:

> On Fri, Dec 13, 2013 at 11:53:06PM +0100, Alexander Hall wrote:
>> On 12/13/13 22:32, Maurice Janssen wrote:
>>> Hi,
>>>
>>> After some discussion on misc@ (see
>>> http://comments.gmane.org/gmane.os.openbsd.misc/209233 ) I came up
>>> with the patch below. Right now, spamd-setup is started with -D in
>>> /etc/rc.  However, when running spamd in blacklist only mode, I think
>>> it's better to start spamd-setup also with -b.  Otherwise, the
>>> <spamd> table in pf is not filled with the data from the blacklists
>>> and spamd is effectively not operational until it is run with -b either
>>> manually or from cron.
>>>
>>> Maurice
>>
>> Diff is whitespace mangled. Care to resend it?
>
> Oops, this one should be better.

Committed as-is (two days ago). Thanks!

/Alexander

>
> Maurice
>
>
>
> Index: rc
> ===================================================================
> RCS file: /cvs/src/etc/rc,v
> retrieving revision 1.407
> diff -u -p -u -r1.407 rc
> --- rc 9 Aug 2013 16:24:54 -0000 1.407
> +++ rc 14 Dec 2013 12:13:27 -0000
> @@ -499,10 +499,6 @@ start_daemon rbootd mopd popa3d spamd sp
>   start_daemon ipropd_master ipropd_slave sndiod
>   echo '.'
>
> -if [ X"${spamd_flags}" != X"NO" ]; then
> - /usr/libexec/spamd-setup -D
> -fi
> -
>   # If rc.firstime exists, run it just once, and make sure it is deleted
>   if [ -f /etc/rc.firsttime ]; then
>   mv /etc/rc.firsttime /etc/rc.firsttime.run
> Index: rc.d/spamd
> ===================================================================
> RCS file: /cvs/src/etc/rc.d/spamd,v
> retrieving revision 1.3
> diff -u -p -u -r1.3 spamd
> --- rc.d/spamd 13 Sep 2013 14:50:56 -0000 1.3
> +++ rc.d/spamd 14 Dec 2013 12:13:27 -0000
> @@ -15,4 +15,12 @@ rc_pre() {
>   return 0
>   }
>
> +rc_start() {
> + ${rcexec} "${daemon} ${daemon_flags} ${_bg}"
> + spamd_setup_flags="-D"
> + [ X"${spamd_black}" != X"NO" ] && \
> + spamd_setup_flags="-b ${spamd_setup_flags}"
> + rc_do rc_wait start && /usr/libexec/spamd-setup ${spamd_setup_flags}
> +}
> +
>   rc_cmd $1
>