]> git.pld-linux.org Git - packages/pound.git/blame - pound.init
- allow some actions when network is down
[packages/pound.git] / pound.init
CommitLineData
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.
19if is_yes "${NETWORKING}"; then
cee31c79 20 if [ ! -f /var/lock/subsys/network -a != stop -a != status ]; then
74738d13 21 # nls "ERROR: Networking is down. %s can't be run." pound
22 msg_network_down pound
23 exit 1
24 fi
59f6c21a 25else
74738d13 26 exit 0
59f6c21a 27fi
28
5917fcaf 29RETVAL=0
59f6c21a 30# See how we were called.
31case "$1" in
32 start)
33 # Check if the service is already running?
74738d13 34 if [ ! -f /var/lock/subsys/pound ]; then
59f6c21a 35 msg_starting pound
74738d13 36 daemon pound -f /etc/pound/pound.cfg
59f6c21a 37 RETVAL=$?
74738d13 38 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pound
59f6c21a 39 else
74738d13 40 msg_already_running pound
59f6c21a 41 fi
42 ;;
43 stop)
74738d13 44 # Stop daemons.
59f6c21a 45 if [ -f /var/lock/subsys/pound ]; then
74738d13 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
59f6c21a 51 fi
52 ;;
53 status)
54 status pound
5917fcaf 55 exit $?
59f6c21a 56 ;;
5917fcaf 57 restart|force-reload)
59f6c21a 58 $0 stop
59 $0 start
5917fcaf 60 exit $?
59f6c21a 61 ;;
62 *)
5917fcaf 63 msg_usage "$0 {start|stop|restart|force-reload|status}"
64 exit 3
59f6c21a 65esac
66
67exit $RETVAL
This page took 0.064955 seconds and 4 git commands to generate.