]>
Commit | Line | Data |
---|---|---|
59f6c21a | 1 | #!/bin/sh |
2 | # | |
7dbb2b59 | 3 | # pound |
59f6c21a | 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 | |
1a0ae1a4 | 20 | if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then |
74738d13 | 21 | msg_network_down pound |
22 | exit 1 | |
23 | fi | |
59f6c21a | 24 | else |
74738d13 | 25 | exit 0 |
59f6c21a | 26 | fi |
27 | ||
5917fcaf | 28 | RETVAL=0 |
59f6c21a | 29 | # See how we were called. |
30 | case "$1" in | |
31 | start) | |
32 | # Check if the service is already running? | |
74738d13 | 33 | if [ ! -f /var/lock/subsys/pound ]; then |
59f6c21a | 34 | msg_starting pound |
74738d13 | 35 | daemon pound -f /etc/pound/pound.cfg |
59f6c21a | 36 | RETVAL=$? |
74738d13 | 37 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pound |
59f6c21a | 38 | else |
74738d13 | 39 | msg_already_running pound |
59f6c21a | 40 | fi |
41 | ;; | |
42 | stop) | |
74738d13 | 43 | # Stop daemons. |
59f6c21a | 44 | if [ -f /var/lock/subsys/pound ]; then |
74738d13 | 45 | msg_stopping pound |
46 | killproc pound | |
47 | rm -f /var/lock/subsys/pound > /dev/null 2>&1 | |
48 | else | |
49 | msg_not_running pound | |
59f6c21a | 50 | fi |
51 | ;; | |
52 | status) | |
53 | status pound | |
5917fcaf | 54 | exit $? |
59f6c21a | 55 | ;; |
5917fcaf | 56 | restart|force-reload) |
59f6c21a | 57 | $0 stop |
58 | $0 start | |
5917fcaf | 59 | exit $? |
59f6c21a | 60 | ;; |
61 | *) | |
5917fcaf | 62 | msg_usage "$0 {start|stop|restart|force-reload|status}" |
63 | exit 3 | |
59f6c21a | 64 | esac |
65 | ||
66 | exit $RETVAL |