summaryrefslogtreecommitdiff
path: root/recipes/spamassassin/files/spamassassin.init
diff options
context:
space:
mode:
authorRoman I Khimov <khimov@altell.ru>2010-03-31 12:32:21 +0400
committerRoman I Khimov <khimov@altell.ru>2010-03-31 22:57:56 +0400
commitd7ff8f75b3110d557a12b315078ab02daec01255 (patch)
tree88e854c94d92a40730cd0d82ccacd46226841a83 /recipes/spamassassin/files/spamassassin.init
parente36460c470bcf8de321de2d483ecf0e2e2c4229a (diff)
spamassassin: new recipe
SpamAssassin is a very powerful and fully configurable spam filter with numerous features including automatic white-listing, RBL testing, Bayesian analysis, header and body text analysis. It is designed to be called from a user's .procmail or .forward file, but can also be integrated into a Mail Transport Agent (MTA). Signed-off-by: Roman I Khimov <khimov@altell.ru>
Diffstat (limited to 'recipes/spamassassin/files/spamassassin.init')
-rw-r--r--recipes/spamassassin/files/spamassassin.init87
1 files changed, 87 insertions, 0 deletions
diff --git a/recipes/spamassassin/files/spamassassin.init b/recipes/spamassassin/files/spamassassin.init
new file mode 100644
index 0000000000..9104f2ced4
--- /dev/null
+++ b/recipes/spamassassin/files/spamassassin.init
@@ -0,0 +1,87 @@
+#! /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
+NAME=spamd
+SNAME=spamassassin
+DESC="SpamAssassin Mail Filter Daemon"
+PIDFILE="/var/run/$NAME.pid"
+
+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 \
+ $NICE --oknodo --exec $DAEMON -- $OPTIONS $DOPTIONS
+ echo "$NAME."
+ ;;
+
+ stop)
+ echo -n "Stopping $DESC: "
+ start-stop-daemon --stop --pidfile $PIDFILE --oknodo
+ echo "$NAME."
+ ;;
+
+ reload|force-reload)
+ echo -n "Reloading $DESC: "
+ start-stop-daemon --stop --pidfile $PIDFILE --signal HUP
+ echo "$NAME."
+ ;;
+
+ restart)
+ echo -n "Restarting $DESC: "
+ start-stop-daemon --stop --pidfile $PIDFILE \
+ --retry 5 --oknodo
+ start-stop-daemon --start --pidfile $PIDFILE \
+ $NICE --oknodo --exec $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