]> git.pld-linux.org Git - packages/exim-lite.git/blame - exim.init
This commit was manufactured by cvs2git to create tag 'auto-ac-exim-4_67-1'.
[packages/exim-lite.git] / exim.init
CommitLineData
0d94143d 1#!/bin/sh
2#
3# exim This shell script takes care of starting and stopping Exim.
4#
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/spool/exim/exim-daemon.pid
11
12# Source function library.
13. /etc/rc.d/init.d/functions
14
15# Source networking configuration.
16. /etc/sysconfig/network
17
18# Source exim configureation.
19if [ -f /etc/sysconfig/exim ]; then
20 . /etc/sysconfig/exim
21else
22 QUEUE=1h
23fi
24
25# Check that networking is up.
26if is_yes "${NETWORKING}"; then
27 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
28 msg_network_down Exim
29 exit 1
30 fi
31else
32 exit 0
33fi
34
35RETVAL=0
36# See how we were called.
37case "$1" in
38 start)
39 # Start daemons.
40 if [ ! -f /var/lock/subsys/exim ]; then
41 msg_starting Exim
42 daemon exim \
43 $( is_yes "$ALLOW_TCP_CONNECTIONS" && echo -bd ) \
44 $( [ -n "$QUEUE" ] && echo -q$QUEUE )
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
52 RETVAL=$?
53 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/exim
54 else
55 msg_already_running Exim
56 fi
57 ;;
58 stop)
59 # Stop daemons.
60 if [ -f /var/lock/subsys/exim ]; then
61 msg_stopping Exim
62 killproc --pidfile /var/spool/exim/exim-daemon.pid exim
63 rm -f /var/lock/subsys/exim >/dev/null 2>&1
64 else
65 msg_not_running Exim
66 fi
67 ;;
68 restart)
69 $0 stop
70 $0 start
71 exit $?
72 ;;
73 status)
74 status exim
75 exit $?
76 ;;
0d94143d 77 reload|force-reload)
78 if [ -f /var/lock/subsys/exim ]; then
c02ee91c 79 msg_reloading Exim
80 killproc exim -HUP
81 RETVAL=$?
0d94143d 82 else
c02ee91c 83 msg_not_running Exim >&2
0d94143d 84 exit 7
85 fi
86 ;;
87 *)
c02ee91c 88 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
0d94143d 89 exit 3
90esac
91
92exit $RETVAL
This page took 0.043711 seconds and 4 git commands to generate.