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 EXIM_CONFIG=/etc/mail/exim.conf
22 # Source exim configureation.
23 if [ -f /etc/sysconfig/exim ]; then
27 # Check that networking is up.
28 if is_yes "${NETWORKING}"; then
29 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
30 msg_network_down "Exim"
38 local details=${1:-0} ret
41 if [ $details = 1 ]; then
42 for CONFIG in "$EXIM_CONFIG" $EXIM_EXTRA_CONFIGS; do
43 run_cmd "Checking exim configuration ($CONFIG)" exim -bV -C $CONFIG
45 if [ $ret != 0 ]; then
50 for CONFIG in "$EXIM_CONFIG" $EXIM_EXTRA_CONFIGS; do
51 exim -bV -C "$CONFIG" > /dev/null 2>&1
53 if [ $ret != 0 ]; then
54 show "Checking %s configuration (%s)" "exim" "$CONFIG"; fail
58 if [ $RETVAL != 0 ]; then
59 nls 'Configuration test failed. See details with %s "checkconfig"' $0
67 if [ -f /var/lock/subsys/exim ]; then
68 msg_already_running "Exim"
73 daemon /usr/bin/exim \
74 -oP /var/spool/exim/exim-daemon.pid \
75 $( is_yes "$ALLOW_TCP_CONNECTIONS" && echo -bd ) \
76 $( [ -n "$QUEUE" ] && echo -q$QUEUE ) \
78 for CONFIG in $EXIM_EXTRA_CONFIGS; do
79 msg_starting "Exim ($CONFIG)"
81 $( is_yes "$ALLOW_TCP_CONNECTIONS" && echo -bd ) \
82 $( [ -n "$QUEUE" ] && echo -q$QUEUE ) \
86 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/exim
91 if [ ! -f /var/lock/subsys/exim ]; then
92 msg_not_running "Exim"
97 killproc --pidfile /var/spool/exim/exim-daemon.pid exim
98 rm -f /var/lock/subsys/exim /var/spool/exim/exim-daemon.pid >/dev/null 2>&1
102 if [ ! -f /var/lock/subsys/exim ]; then
103 msg_not_running "Exim"
114 if [ ! -f /var/lock/subsys/exim ]; then
115 msg_not_running "Exim"
127 # See how we were called.
146 checkconfig|configtest)
154 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|configtest|status}"