]> git.pld-linux.org Git - packages/spamassassin.git/blobdiff - spamassassin-spamd.init
- disable t/trust_path.t test
[packages/spamassassin.git] / spamassassin-spamd.init
index 3865ef23a138dfbfe8de68dc2295114a6f22ba8c..07c17c019a795c08d6262a536d248499adedb22a 100644 (file)
@@ -8,7 +8,7 @@
 #              email messages for SPAM.  It is normally called by spamc \
 #              from a MDA.
 # processname: spamd
-# pidfile:     /var/run/spamassassin.pid
+# pidfile:     /var/run/spamd.pid
 
 # Source function library.
 . /etc/rc.d/init.d/functions
@@ -36,13 +36,13 @@ start() {
        fi
 
        # Check if database is installed.
-       if [ "$(find /var/lib/spamassassin/ -name '*.cf' | wc -l)" == 0 ]; then
+       if [ "$(find /var/lib/spamassassin/ -name '*.cf' | head -n1 | wc -l)" -eq 0 ]; then
                show 'Spamassassin database not found. Run sa-update first.'; fail
                return 1
        fi
 
        msg_starting "SpamAssassin"
-       daemon /usr/bin/spamd $SPAMD_OPTS
+       daemon /usr/bin/spamd -r /var/run/spamd.pid $SPAMD_OPTS
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/spamd
 }
@@ -55,7 +55,7 @@ stop() {
        fi
 
        msg_stopping "SpamAssassin"
-       killproc spamd
+       killproc --pidfile spamd.pid spamd
        RETVAL=$?
        rm -f /var/lock/subsys/spamd
 }
@@ -74,10 +74,10 @@ condrestart() {
 # See how we were called.
 case "$1" in
   start)
-       start
+       start
        ;;
   stop)
-       stop
+       stop
        ;;
   restart)
        stop
@@ -90,7 +90,7 @@ case "$1" in
        condrestart 7
        ;;
   status)
-       status spamd
+       status --pidfile spamd.pid spamd
        ;;
   *)
        msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
This page took 0.060843 seconds and 4 git commands to generate.