]> git.pld-linux.org Git - packages/exim.git/blame - exim.init
- up to 4.72; info files no longer available upstream; fixes CVE-2010-2023
[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
6e5ecf1d 63 rm -f /var/lock/subsys/exim /var/spool/exim/exim-daemon.pid >/dev/null 2>&1
9e7b57a4 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 ;;
7f8aac0d
ER
77 configtest)
78 exim -bV || exit $?
79 ;;
80
d1e99794 81 reload|force-reload)
82 if [ -f /var/lock/subsys/exim ]; then
7f8aac0d
ER
83 run_cmd "Checking exim configuration" exim -bV
84 if [ $? -eq 0 ]; then
85 msg_reloading Exim
86 killproc exim -HUP
87 RETVAL=$?
88 fi
d1e99794 89 else
b0c3afea 90 msg_not_running Exim
d1e99794 91 exit 7
92 fi
ee785f0b 93 ;;
6a7ed0b9 94 *)
7f8aac0d 95 msg_usage "$0 {start|stop|restart|reload|force-reload|configtest|status}"
d1e99794 96 exit 3
6a7ed0b9 97esac
98
9e7b57a4 99exit $RETVAL
This page took 0.041814 seconds and 4 git commands to generate.