You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by do...@apache.org on 2005/11/20 06:01:54 UTC

svn commit: r345719 - /spamassassin/branches/3.1/spamd/redhat-rc-script.sh

Author: dos
Date: Sat Nov 19 21:01:50 2005
New Revision: 345719

URL: http://svn.apache.org/viewcvs?rev=345719&view=rev
Log:
bug 4655: have redhat-rc-script create .pid file for spamassassin service to avoid killing the wrong processes and leaving spamd running

Modified:
    spamassassin/branches/3.1/spamd/redhat-rc-script.sh

Modified: spamassassin/branches/3.1/spamd/redhat-rc-script.sh
URL: http://svn.apache.org/viewcvs/spamassassin/branches/3.1/spamd/redhat-rc-script.sh?rev=345719&r1=345718&r2=345719&view=diff
==============================================================================
--- spamassassin/branches/3.1/spamd/redhat-rc-script.sh (original)
+++ spamassassin/branches/3.1/spamd/redhat-rc-script.sh Sat Nov 19 21:01:50 2005
@@ -19,6 +19,7 @@
 
 # Set default spamd configuration.
 SPAMDOPTIONS="-d -c -m5 -H"
+SPAMD_PID=/var/run/spamassassin/spamd.pid
 
 # Source spamd configuration.
 if [ -f /etc/sysconfig/spamassassin ] ; then
@@ -36,10 +37,13 @@
   start)
 	# Start daemon.
 	echo -n "Starting spamd: "
-	daemon $NICELEVEL spamd $SPAMDOPTIONS
+	daemon $NICELEVEL spamd $SPAMDOPTIONS -r $SPAMD_PID
 	RETVAL=$?
         echo
-        [ $RETVAL = 0 ] && touch /var/lock/subsys/spamassassin
+	if [ $RETVAL = 0 ]; then
+		[ -n "$SPAMD_PID" ] && ln -s $SPAMD_PID /var/run/spamd.pid
+		touch /var/lock/subsys/spamassassin
+	fi
         ;;
   stop)
         # Stop daemons.
@@ -47,7 +51,10 @@
         killproc spamd
         RETVAL=$?
         echo
-        [ $RETVAL = 0 ] && rm -f /var/lock/subsys/spamassassin
+	if [ $RETVAL = 0 ]; then
+		rm -f /var/lock/subsys/spamassassin
+		rm -f /var/run/spamd.pid
+	fi
         ;;
   restart)
         $0 stop