2009-12-21 20:58:46 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
2010-02-04 14:52:04 +00:00
|
|
|
# Copyright (C) 2009-2010 OpenWrt.org
|
2009-12-21 20:58:46 +00:00
|
|
|
|
|
|
|
START=99
|
|
|
|
STOP=80
|
|
|
|
|
|
|
|
HAPROXY_BIN="/usr/sbin/haproxy"
|
|
|
|
HAPROXY_CONFIG="/etc/haproxy.cfg"
|
|
|
|
HAPROXY_PID="/var/run/haproxy.pid"
|
|
|
|
|
2010-03-19 21:02:23 +00:00
|
|
|
boot() {
|
|
|
|
|
|
|
|
#Do nothing on boot
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2009-12-21 20:58:46 +00:00
|
|
|
start() {
|
|
|
|
[ -x "$HAPROXY_BIN" ] || return 1
|
|
|
|
|
2010-02-04 14:52:04 +00:00
|
|
|
start-stop-daemon -S -x $HAPROXY_BIN -- \
|
|
|
|
-f "$HAPROXY_CONFIG" -V -D -p "$HAPROXY_PID"
|
2009-12-21 20:58:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2010-02-04 14:52:04 +00:00
|
|
|
start-stop-daemon -q -K -x $HAPROXY_BIN -p $HAPROXY_PID
|
|
|
|
sleep 3
|
|
|
|
kill -0 `cat $HAPROXY_PID` 2>/dev/null && \
|
|
|
|
start-stop-daemon -q -K -s KILL -x $HAPROXY_BIN -p $HAPROXY_PID
|
2009-12-21 20:58:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
reload() {
|
|
|
|
$HAPROXY_BIN -f $HAPROXY_CONFIG -p $HAPROXY_PID -st $(cat $HAPROXY_PID)
|
|
|
|
}
|