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