]> git.pld-linux.org Git - packages/pound.git/blob - pound.init
0e30dc2c470e83785bbb571dbcf236a773882e1e
[packages/pound.git] / pound.init
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
30 # See how we were called.
31 case "$1" in
32   start)
33         # Check if the service is already running?
34         if [ ! -f /var/lock/subsys/pound ]; then
35                 msg_starting pound
36                 daemon pound -f /etc/pound/pound.cfg
37                 RETVAL=$?
38                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pound
39         else
40                 msg_already_running pound
41                 exit 1
42         fi
43         ;;
44   stop)
45         # Stop daemons.
46         if [ -f /var/lock/subsys/pound ]; then
47                 msg_stopping pound
48                 killproc pound
49                 rm -f /var/lock/subsys/pound > /dev/null 2>&1
50         else
51                 msg_not_running pound
52                 exit 1
53         fi
54         ;;
55   status)
56         status pound
57         RETVAL=$?
58         exit $RETVAL
59         ;;
60   restart|reload)
61         $0 stop
62         $0 start
63         ;;
64   *)
65         msg_usage "$0 {start|stop|restart|reload|status}"
66         exit 1
67         ;;
68 esac
69
70 exit $RETVAL
This page took 0.02741 seconds and 3 git commands to generate.