From 1ead9453f3dfc28cf797aafbcc7b6e56b69c4770 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 12 Jul 2012 21:13:27 -0700 Subject: small improvements --- tools/spamassassin | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100755 tools/spamassassin (limited to 'tools/spamassassin') diff --git a/tools/spamassassin b/tools/spamassassin new file mode 100755 index 0000000..781adb9 --- /dev/null +++ b/tools/spamassassin @@ -0,0 +1,89 @@ +#! /bin/sh + +### BEGIN INIT INFO +# Provides: spamassassin +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Should-Start: $network $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +### END INIT INFO + +# Spamd init script +# June 2002 +# Duncan Findlay + +# Based on skeleton by Miquel van Smoorenburg and Ian Murdock + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/spamd +DAEMON=/usr/local/bin/spamd ## jsd +NAME=spamd +SNAME=spamassassin +DESC="SpamAssassin Mail Filter Daemon" +PIDFILE="/var/run/$NAME.pid" +XNAME=/usr/bin/perl + +export TMPDIR=/tmp +# Apparently people have trouble if this isn't explicitly set... + +# Defaults - don't touch, edit /etc/default/spamassassin +ENABLED=0 +OPTIONS="" +NICE= + +. /lib/lsb/init-functions + +test -f /etc/default/spamassassin && . /etc/default/spamassassin + +DOPTIONS="-d --pidfile=$PIDFILE" + +if [ "$ENABLED" = "0" ]; then + echo "$DESC: disabled, see /etc/default/spamassassin" + exit 0 +fi + +test -f $DAEMON || exit 0 + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon --start --pidfile $PIDFILE --exec $XNAME \ + $NICE --oknodo --startas $DAEMON -- $OPTIONS $DOPTIONS + echo "$NAME." + ;; + + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop --pidfile $PIDFILE --exec $XNAME --oknodo + echo "$NAME." + ;; + + reload|force-reload) + echo -n "Reloading $DESC: " + start-stop-daemon --stop --pidfile $PIDFILE --signal HUP --exec $XNAME + echo "$NAME." + ;; + + restart) + echo -n "Restarting $DESC: " + start-stop-daemon --stop --pidfile $PIDFILE --exec $XNAME \ + --retry 5 --oknodo + start-stop-daemon --start --pidfile $PIDFILE --exec $XNAME \ + $NICE --oknodo --startas $DAEMON -- $OPTIONS $DOPTIONS + + echo "$NAME." + ;; + status) + status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? + ;; + *) + N=/etc/init.d/$SNAME + echo "Usage: $N {start|stop|restart|reload|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0 -- cgit v1.2.3