]> git.pld-linux.org Git - packages/exim.git/blame - exim.init
- rebuild with new db4.5
[packages/exim.git] / exim.init
CommitLineData
6a7ed0b9 1#!/bin/sh
2#
c0b03131 3# exim This shell script takes care of starting and stopping Exim.
6a7ed0b9 4#
c0b03131
JR
5# chkconfig: 2345 80 30
6# description: Exim is a Mail Transport Agent, which is the program \
7# that moves mail from one machine to another.
8# processname: exim
9# config: /etc/exim.cf
2b4493b8 10# pidfile: /var/spool/exim/exim-daemon.pid
9c228cad
AM
11
12# Source function library.
6a7ed0b9 13. /etc/rc.d/init.d/functions
14
9c228cad 15# Source networking configuration.
6a7ed0b9 16. /etc/sysconfig/network
17
c0b03131 18# Source exim configureation.
2afc326a 19if [ -f /etc/sysconfig/exim ]; then
9c228cad 20 . /etc/sysconfig/exim
6a7ed0b9 21else
6a7ed0b9 22 QUEUE=1h
23fi
24
01e5d0f3 25# Check that networking is up.
f188b1d5 26if is_yes "${NETWORKING}"; then
d809ed84 27 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
f188b1d5 28 msg_network_down Exim
29 exit 1
30 fi
31else
32 exit 0
c0b03131 33fi
01e5d0f3 34
d1e99794 35RETVAL=0
6a7ed0b9 36# See how we were called.
37case "$1" in
38 start)
9c228cad 39 # Start daemons.
9e7b57a4 40 if [ ! -f /var/lock/subsys/exim ]; then
41 msg_starting Exim
9dd2435d
SZ
42 daemon exim \
43 $( is_yes "$ALLOW_TCP_CONNECTIONS" && echo -bd ) \
44 $( [ -n "$QUEUE" ] && echo -q$QUEUE )
955376d5 45 for CONFIG in $EXIM_EXTRA_CONFIGS; do
46 msg_starting "Exim ($CONFIG)"
47 daemon exim \
48 $( is_yes "$ALLOW_TCP_CONNECTIONS" && echo -bd ) \
49 $( [ -n "$QUEUE" ] && echo -q$QUEUE ) \
50 -C $CONFIG
51 done
9e7b57a4 52 RETVAL=$?
53 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/exim
54 else
f188b1d5 55 msg_already_running Exim
9e7b57a4 56 fi
6a7ed0b9 57 ;;
58 stop)
59 # Stop daemons.
9e7b57a4 60 if [ -f /var/lock/subsys/exim ]; then
61 msg_stopping Exim
2b4493b8 62 killproc --pidfile /var/spool/exim/exim-daemon.pid exim
9e7b57a4 63 rm -f /var/lock/subsys/exim >/dev/null 2>&1
64 else
f188b1d5 65 msg_not_running Exim
413446e5 66 fi
6a7ed0b9 67 ;;
9c228cad 68 restart)
6a7ed0b9 69 $0 stop
70 $0 start
d1e99794 71 exit $?
6a7ed0b9 72 ;;
73 status)
74 status exim
d1e99794 75 exit $?
6a7ed0b9 76 ;;
d1e99794 77 reload|force-reload)
78 if [ -f /var/lock/subsys/exim ]; then
79 msg_reloading Exim
80 killproc exim -HUP
81 RETVAL=$?
82 else
b0c3afea 83 msg_not_running Exim
d1e99794 84 exit 7
85 fi
ee785f0b 86 ;;
6a7ed0b9 87 *)
d1e99794 88 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
89 exit 3
6a7ed0b9 90esac
91
9e7b57a4 92exit $RETVAL
This page took 0.035588 seconds and 4 git commands to generate.