]> git.pld-linux.org Git - packages/pound.git/blame - pound.init
- use functions
[packages/pound.git] / pound.init
CommitLineData
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.
19if 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 24else
74738d13 25 exit 0
59f6c21a 26fi
27
50de9853 28start() {
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
40stop() {
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
51RETVAL=0
52# See how we were called.
53case "$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 71esac
72
73exit $RETVAL
This page took 0.134588 seconds and 4 git commands to generate.