]>
Commit | Line | Data |
---|---|---|
38eca8a6 AM |
1 | #!/bin/bash |
2 | # | |
3 | # eximstatedd Start/Stop eximstated server | |
4 | # | |
5 | # chkconfig: 345 85 25 | |
6 | # description: eximstated - exim queue statistics | |
7 | # | |
8 | # processname: eximstated | |
9 | ||
10 | # Source function library | |
11 | . /etc/rc.d/init.d/functions | |
12 | ||
13 | # Get network config | |
14 | . /etc/sysconfig/network | |
15 | ||
16 | # Get service config | |
17 | [ -f /etc/sysconfig/eximstated ] && . /etc/sysconfig/eximstated | |
18 | ||
19 | # Check that networking is up. | |
20 | if is_yes "${NETWORKING}"; then | |
0a6c4f14 | 21 | if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then |
dca643d4 | 22 | # nls "ERROR: Networking is down. %s can't be run." <service> |
23 | msg_network_down eximstated | |
24 | exit 1 | |
25 | fi | |
38eca8a6 | 26 | else |
dca643d4 | 27 | exit 0 |
38eca8a6 AM |
28 | fi |
29 | ||
f430066e | 30 | RETVAL=0 |
38eca8a6 AM |
31 | # See how we were called. |
32 | case "$1" in | |
33 | start) | |
34 | # Check if the service is already running? | |
35 | if [ ! -f /var/lock/subsys/eximstated ]; then | |
36 | msg_starting "eximstated" | |
37 | daemon eximstated | |
38 | RETVAL=$? | |
39 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/eximstated | |
40 | else | |
41 | msg_already_running eximstated | |
42 | exit 1 | |
43 | fi | |
dca643d4 | 44 | ;; |
38eca8a6 | 45 | stop) |
dca643d4 | 46 | # Stop daemons. |
38eca8a6 AM |
47 | if [ -f /var/lock/subsys/eximstated ]; then |
48 | msg_stopping eximstated | |
49 | killproc eximstated | |
50 | rm -f /var/lock/subsys/eximstated >/dev/null 2>&1 | |
51 | else | |
52 | msg_not_running eximstated | |
38eca8a6 | 53 | fi |
dca643d4 | 54 | ;; |
38eca8a6 | 55 | restart) |
dca643d4 | 56 | $0 stop |
38eca8a6 | 57 | $0 start |
f430066e | 58 | exit $? |
dca643d4 | 59 | ;; |
f430066e | 60 | reload|force-reload) |
38eca8a6 AM |
61 | if [ -f /var/lock/subsys/eximstated ]; then |
62 | msg_reloaging eximstated | |
63 | killproc eximstatedd -HUP | |
f430066e | 64 | RETVAL=$? |
38eca8a6 | 65 | else |
f430066e | 66 | msg_not_running eximstatedd >&2 |
67 | exit 7 | |
38eca8a6 AM |
68 | fi |
69 | ;; | |
38eca8a6 AM |
70 | status) |
71 | status eximstated | |
72 | exit $? | |
dca643d4 | 73 | ;; |
38eca8a6 | 74 | *) |
dca643d4 | 75 | # show "Usage: %s {start|stop|restart|reload|force-reload|status}" |
76 | msg_usage "$0 {start|stop|restart|reload|force-reload|status}" | |
f430066e | 77 | exit 3 |
38eca8a6 AM |
78 | esac |
79 | ||
80 | exit $RETVAL |