]>
Commit | Line | Data |
---|---|---|
59f6c21a | 1 | #!/bin/sh |
2 | # | |
3 | # pound | |
4 | # | |
5 | # chkconfig: 345 85 15 | |
6 | # description: reverse-proxy and load-balancer | |
7 | # | |
8 | ||
9 | # Source function library | |
10 | . /etc/rc.d/init.d/functions | |
11 | ||
12 | # Get network config | |
13 | . /etc/sysconfig/network | |
14 | ||
15 | # Get service config | |
16 | [ -f /etc/sysconfig/pound ] && . /etc/sysconfig/pound | |
17 | ||
18 | # Check that networking is up. | |
19 | if is_yes "${NETWORKING}"; then | |
20 | if [ ! -f /var/lock/subsys/network ]; then | |
21 | # nls "ERROR: Networking is down. %s can't be run." pound | |
22 | msg_network_down pound | |
23 | exit 1 | |
24 | fi | |
25 | else | |
26 | exit 0 | |
27 | fi | |
28 | ||
29 | # See how we were called. | |
30 | case "$1" in | |
31 | start) | |
32 | # Check if the service is already running? | |
33 | if [ ! -f /var/lock/subsys/pound ]; then | |
34 | msg_starting pound | |
35 | daemon pound -f /etc/pound/pound.cfg | |
36 | RETVAL=$? | |
37 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pound | |
38 | else | |
39 | msg_Already_Running pound | |
40 | exit 1 | |
41 | fi | |
42 | ;; | |
43 | stop) | |
44 | # Stop daemons. | |
45 | if [ -f /var/lock/subsys/pound ]; then | |
46 | msg_stopping pound | |
47 | killproc pound | |
48 | rm -f /var/lock/subsys/pound > /dev/null 2>&1 | |
49 | else | |
50 | msg_Not_Running pound | |
51 | exit 1 | |
52 | fi | |
53 | ;; | |
54 | status) | |
55 | status pound | |
56 | RETVAL=$? | |
57 | exit $RETVAL | |
58 | ;; | |
59 | restart|reload) | |
60 | $0 stop | |
61 | $0 start | |
62 | ;; | |
63 | *) | |
64 | msg_Usage "$0 {start|stop|restart|status}" | |
65 | exit 1 | |
66 | ;; | |
67 | esac | |
68 | ||
69 | exit $RETVAL | |
70 |