]>
Commit | Line | Data |
---|---|---|
38eca8a6 AM |
1 | #!/bin/bash |
2 | # | |
3 | # eximstated Start/Stop eximstate server | |
4 | # | |
0f88cdae | 5 | # chkconfig: 345 86 24 |
38eca8a6 AM |
6 | # description: eximstate - exim queue statistics |
7 | # | |
8 | # processname: eximstate | |
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/eximstate ] && . /etc/sysconfig/eximstate | |
18 | ||
19 | # Check that networking is up. | |
20 | if is_yes "${NETWORKING}"; then | |
7ee77001 | 21 | if [ ! -f /var/lock/subsys/network -a != stop -a != status ]; then |
dca643d4 | 22 | # nls "ERROR: Networking is down. %s can't be run." <service> |
23 | msg_network_down eximstate | |
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/eximstate ]; then | |
36 | msg_starting "eximstate" | |
37 | daemon eximstate | |
38 | RETVAL=$? | |
39 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/eximstate | |
40 | else | |
41 | msg_already_running eximstate | |
38eca8a6 | 42 | fi |
dca643d4 | 43 | ;; |
38eca8a6 | 44 | stop) |
dca643d4 | 45 | # Stop daemons. |
38eca8a6 AM |
46 | if [ -f /var/lock/subsys/eximstate ]; then |
47 | msg_stopping eximstate | |
48 | killproc eximstate | |
49 | rm -f /var/lock/subsys/eximstate >/dev/null 2>&1 | |
50 | else | |
51 | msg_not_running eximstate | |
38eca8a6 | 52 | fi |
dca643d4 | 53 | ;; |
38eca8a6 | 54 | restart) |
dca643d4 | 55 | $0 stop |
38eca8a6 | 56 | $0 start |
f430066e | 57 | exit $? |
dca643d4 | 58 | ;; |
f430066e | 59 | reload|force-reload) |
38eca8a6 AM |
60 | if [ -f /var/lock/subsys/eximstate ]; then |
61 | msg_reloaging eximstate | |
62 | killproc eximstated -HUP | |
f430066e | 63 | RETVAL=$? |
38eca8a6 | 64 | else |
f430066e | 65 | msg_not_running eximstated >&2 |
66 | exit 7 | |
38eca8a6 AM |
67 | fi |
68 | ;; | |
38eca8a6 AM |
69 | status) |
70 | status eximstate | |
71 | exit $? | |
dca643d4 | 72 | ;; |
38eca8a6 | 73 | *) |
dca643d4 | 74 | # show "Usage: %s {start|stop|restart|reload|force-reload|status}" |
75 | msg_usage "$0 {start|stop|restart|reload|force-reload|status}" | |
f430066e | 76 | exit 3 |
38eca8a6 AM |
77 | esac |
78 | ||
79 | exit $RETVAL |