b691ec8c949c4a3ab7334c2e55d895ab369d3f17
[openwrt/svn-archive/archive.git] / net / haproxy / files / haproxy.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2009-2010 OpenWrt.org
3
4 START=99
5 STOP=80
6
7 HAPROXY_BIN="/usr/sbin/haproxy"
8 HAPROXY_CONFIG="/etc/haproxy.cfg"
9 HAPROXY_PID="/var/run/haproxy.pid"
10
11 boot() {
12
13 #Do nothing on boot
14 exit 0
15 }
16
17 start() {
18 [ -x "$HAPROXY_BIN" ] || return 1
19
20 start-stop-daemon -S -x $HAPROXY_BIN -- \
21 -f "$HAPROXY_CONFIG" -V -D -p "$HAPROXY_PID"
22 }
23
24 stop() {
25 service_kill ${HAPROXY_BIN##*/} $HAPROXY_PID
26 rm -f $HAPROXY_PID
27 }
28
29 reload() {
30 $HAPROXY_BIN -f $HAPROXY_CONFIG -p $HAPROXY_PID -sf $(<$HAPROXY_PID)
31 }