]> git.pld-linux.org Git - packages/exim-lite.git/blame - exim.init
- allow some actions when network is down
[packages/exim-lite.git] / exim.init
CommitLineData
cdaabff3 1#!/bin/sh
2#
d1b56fb4 3# exim This shell script takes care of starting and stopping Exim.
cdaabff3 4#
d1b56fb4
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
10# pidfile: /var/run/exim.pid
1248b360
AM
11
12# Source function library.
cdaabff3 13. /etc/rc.d/init.d/functions
14
1248b360 15# Source networking configuration.
cdaabff3 16. /etc/sysconfig/network
17
d1b56fb4 18# Source exim configureation.
46b2fd4f 19if [ -f /etc/sysconfig/exim ]; then
1248b360 20 . /etc/sysconfig/exim
cdaabff3 21else
cdaabff3 22 QUEUE=1h
23fi
24
d6a5e20a 25# Check that networking is up.
0e82dd22 26if is_yes "${NETWORKING}"; then
56b950db 27 if [ ! -f /var/lock/subsys/network -a != stop -a != status ]; then
0e82dd22 28 msg_network_down Exim
29 exit 1
30 fi
31else
32 exit 0
d1b56fb4 33fi
d6a5e20a 34
2a1db38a 35RETVAL=0
cdaabff3 36# See how we were called.
37case "$1" in
38 start)
1248b360 39 # Start daemons.
10329cff 40 if [ ! -f /var/lock/subsys/exim ]; then
41 msg_starting Exim
5695d551
SZ
42 daemon exim \
43 $( is_yes "$ALLOW_TCP_CONNECTIONS" && echo -bd ) \
44 $( [ -n "$QUEUE" ] && echo -q$QUEUE )
10329cff 45 RETVAL=$?
46 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/exim
47 else
0e82dd22 48 msg_already_running Exim
10329cff 49 fi
cdaabff3 50 ;;
51 stop)
52 # Stop daemons.
10329cff 53 if [ -f /var/lock/subsys/exim ]; then
54 msg_stopping Exim
55 killproc exim
56 rm -f /var/lock/subsys/exim >/dev/null 2>&1
57 else
0e82dd22 58 msg_not_running Exim
10329cff 59 fi
cdaabff3 60 ;;
1248b360 61 restart)
cdaabff3 62 $0 stop
63 $0 start
2a1db38a 64 exit $?
cdaabff3 65 ;;
66 status)
67 status exim
2a1db38a 68 exit $?
cdaabff3 69 ;;
2a1db38a 70 reload|force-reload)
71 if [ -f /var/lock/subsys/exim ]; then
72 msg_reloading Exim
73 killproc exim -HUP
74 RETVAL=$?
75 else
76 msg_not_running Exim >&2
77 exit 7
78 fi
c7803849 79 ;;
cdaabff3 80 *)
2a1db38a 81 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
82 exit 3
cdaabff3 83esac
84
10329cff 85exit $RETVAL
This page took 0.061739 seconds and 4 git commands to generate.