packages/net/haproxy/files/haproxy.init
florian 5d5bd183a8 [package] update haproxy to 1.4.1 and add hotplug script (#6875)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@20309 3c298f89-4303-0410-b956-a3cf2f4a3e73
2010-03-19 21:02:23 +00:00

34 lines
640 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2009-2010 OpenWrt.org
START=99
STOP=80
HAPROXY_BIN="/usr/sbin/haproxy"
HAPROXY_CONFIG="/etc/haproxy.cfg"
HAPROXY_PID="/var/run/haproxy.pid"
boot() {
#Do nothing on boot
exit 0
}
start() {
[ -x "$HAPROXY_BIN" ] || return 1
start-stop-daemon -S -x $HAPROXY_BIN -- \
-f "$HAPROXY_CONFIG" -V -D -p "$HAPROXY_PID"
}
stop() {
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
}
reload() {
$HAPROXY_BIN -f $HAPROXY_CONFIG -p $HAPROXY_PID -st $(cat $HAPROXY_PID)
}