summaryrefslogtreecommitdiff
path: root/debian/init.d
blob: ff8422ac4a26f2b4f00174e37f247943dd678561 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh

# Start or stop sendmail
#
# Robert Leslie <rob@mars.org>
# Johnie Ingram <johnie@netgod.net>
# David Rocher <rocher@mail.dotcom.fr>
# Richard Nelson <cowboy@debain.org>

# How often to run the queue
Q="10m"

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/sendmail
PIDFILE=/var/run/sendmail.pid
NAME=sendmail
FLAGS="defaults 50"

test -x $DAEMON -a -f /etc/sendmail.cf || exit 0

case "$1" in
    start)
	( cd /var/spool/mqueue && rm -f [lnx]f* )
	echo -n "Starting mail transport agent: sendmail"
	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- -bd -q"$Q"
	echo "."
    ;;

    stop)
	echo -n "Stopping mail transport agent: sendmail"
	start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON
	echo "." 
    ;;

    restart)
        $0 stop
        $0 start
    ;;
    
    reload)
	echo -n "Reloading sendmail configuration..."
	start-stop-daemon --stop --signal 1 --quiet  \
	    --pidfile $PIDFILE --exec $DAEMON
	echo "done." 
    ;;

    force-reload)
        $0 reload
    ;;

    debug)
	start-stop-daemon --stop --signal 10 --verbose  \
	    --pidfile $PIDFILE --exec $DAEMON
    ;;

    *)
	echo "Usage: /etc/init.d/sendmail {start|stop|restart|reload|force-reload|debug}"
	exit 1
    ;;
esac

exit 0