3 # exim This shell script takes care of starting and stopping Exim.
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.
10 # pidfile: /var/spool/exim/exim-daemon.pid
12 # Source function library.
13 . /etc/rc.d/init.d/functions
15 # Source networking configuration.
16 . /etc/sysconfig/network
20 # Source exim configureation.
21 if [ -f /etc/sysconfig/exim ]; then
25 # Check that networking is up.
26 if is_yes "${NETWORKING}"; then
27 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
28 msg_network_down "Exim"
36 local details=${1:-0} ret
39 if [ $details = 1 ]; then
40 for CONFIG in /etc/mail/exim.conf $EXIM_EXTRA_CONFIGS; do
41 run_cmd "Checking exim configuration ($CONFIG)" exim -bV -C $CONFIG
43 if [ $ret != 0 ]; then
48 for CONFIG in /etc/mail/exim.conf $EXIM_EXTRA_CONFIGS; do
49 exim -bV -C $CONFIG > /dev/null 2>&1
51 if [ $ret != 0 ]; then
52 show "Checking %s configuration (%s)" "exim" "$CONFIG"; fail
56 if [ $RETVAL != 0 ]; then
57 nls 'Configuration test failed. See details with %s "checkconfig"' $0
65 if [ -f /var/lock/subsys/exim ]; then
66 msg_already_running "Exim"
71 daemon /usr/bin/exim \
72 -oP /var/spool/exim/exim-daemon.pid \
73 $( is_yes "$ALLOW_TCP_CONNECTIONS" && echo -bd ) \
74 $( [ -n "$QUEUE" ] && echo -q$QUEUE )
75 for CONFIG in $EXIM_EXTRA_CONFIGS; do
76 msg_starting "Exim ($CONFIG)"
78 $( is_yes "$ALLOW_TCP_CONNECTIONS" && echo -bd ) \
79 $( [ -n "$QUEUE" ] && echo -q$QUEUE ) \
83 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/exim
88 if [ ! -f /var/lock/subsys/exim ]; then
89 msg_not_running "Exim"
94 killproc --pidfile /var/spool/exim/exim-daemon.pid exim
95 rm -f /var/lock/subsys/exim /var/spool/exim/exim-daemon.pid >/dev/null 2>&1
99 if [ ! -f /var/lock/subsys/exim ]; then
100 msg_not_running "Exim"
111 if [ ! -f /var/lock/subsys/exim ]; then
112 msg_not_running "Exim"
124 # See how we were called.
143 checkconfig|configtest)
151 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|configtest|status}"