On 12/10/13 14:03, Craig R. Skinner wrote:
On 2013-12-10 Tue 09:26 AM |, Alexander Hall wrote:

The OP is referring to this part of /etc/rc, which has nothing to do
with neither crontab nor /etc/rc.d/*.

if [ X"${spamd_flags}" != X"NO" ]; then
         /usr/libexec/spamd-setup -D
fi

Indeed, please suggest a diff.

Maybe we should just incorporate that into /etc/rc.d/spamd instead?


This has worked OK for me for a few months:


Index: rc
===================================================================
RCS file: /cvs/src/etc/rc,v
retrieving revision 1.407
diff -u -u -p -r1.407 rc
--- rc  9 Aug 2013 16:24:54 -0000       1.407
+++ rc  10 Dec 2013 12:59:49 -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
-

yes

  # 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 -u -p -r1.3 spamd
--- rc.d/spamd  13 Sep 2013 14:50:56 -0000      1.3
+++ rc.d/spamd  10 Dec 2013 12:59:49 -0000
@@ -1,18 +1,23 @@
  #!/bin/sh
  #
-# $OpenBSD: spamd,v 1.3 2013/09/13 14:50:56 okan Exp $
+# $OpenBSD: spamd,v 1.4 2013/09/05 19:08:22 skinner Exp $

-daemon="/usr/libexec/spamd"
+daemon='/usr/libexec/spamd'

noise


  . /etc/rc.d/rc.subr

  pexp="spamd: \[priv\]"
  rc_reload=NO

-rc_pre() {
-       [ X"${spamd_black}" != X"NO" ] && \
-               daemon_flags="-b ${daemon_flags}"
-       return 0
+rc_pre()
+{
+       [[ ${spamd_black} == 'NO' ]] || daemon_flags="-b ${daemon_flags}"
+}

noise (and ksh syntax)

+
+rc_start()
+{
+       ${rcexec} "${daemon} ${daemon_flags} ${_bg}"
+       rc_do rc_wait start && ${daemon}-setup -D

useful, but IMO in wrong order and misses the -b flag.

/Alexander

  }

  rc_cmd $1



Cheers,

Reply via email to