5 # Sample init script for Debian GNU/Linux
7 # Copyright (c) 2002 Georg C. F. Greve <greve@gnu.org>,
8 # all rights maintained by FSF Europe e.V.,
9 # Villa Vogelsang, Antonienallee 1, 45279 Essen, Germany
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 # Michael Brown <michaelb@opentext.com>
28 # This init script was modified on Thu, 30 Jan 2003 02:06:04 -0500 by
29 # Don Armstrong <don@donarmstrong.com> from contrib/spamass-milter to
30 # allow force-reload and options specified in
31 # /etc/default/spamass-milter necessary for inclusion in debian.
34 PATH=/sbin:/bin:/usr/sbin:/usr/bin
35 DAEMON=/usr/sbin/spamass-milter
36 SOCKET=/var/run/sendmail/spamass.sock
37 PIDFILE=/var/run/spamass.pid
38 DESC="Sendmail milter plugin for SpamAssassin"
40 DEFAULT=/etc/default/spamass-milter
45 test -x $DAEMON || exit 0
47 # If /usr/sbin/postfix exists, set up the defaults for a postfix install
48 # These can be overridden in /etc/default/spamass-milter
49 if [ -x /usr/sbin/posfix ]; then
50 SOCKET="/var/spool/postfix/spamass/spamass.sock"
51 RUNAS="postfix:postfix"
52 PIDFILE="/var/spool/postfix/spamass/spamass.pid"
55 if [ -r $DEFAULT ]; then
59 if [ -n "$RUNAS" ]; then
60 CHUID="--chuid $RUNAS";
67 echo -n "Starting $DESC: "
69 if [ ! -d $(dirname $SOCKET) ]; then
70 mkdir -p $(dirname $SOCKET);
71 if [ -n "$RUNAS" ]; then
72 chown "$RUNAS" $(dirname $SOCKET);
75 if [ ! -d $(dirname $PIDFILE) ]; then
76 mkdir -p $(dirname $PIDFILE);
77 if [ -n "$RUNAS" ]; then
78 chown "$RUNAS" $(dirname $PIDFILE);
81 start-stop-daemon --start -p $PIDFILE $CHUID --exec $DAEMON -- -P $PIDFILE -f -p $SOCKET $OPTIONS
86 echo -n "Stopping $DESC: "
88 start-stop-daemon --stop -p $PIDFILE --signal 3 --exec $DAEMON
94 force-reload | restart)
95 echo -n "Restarting $DESC: "
97 start-stop-daemon --stop -p $PIDFILE --signal 3 --exec $DAEMON
100 start-stop-daemon --start -p $PIDFILE --exec $DAEMON -- -P $PIDFILE -f -p $SOCKET $OPTIONS
107 echo "Usage: $N {start|stop|restart}" >&2