packages/net/haproxy/files/haproxy.init
jow 5f12dc696f [packages] haproxy: update to v1.3.23, fix restart action
git-svn-id: svn://svn.openwrt.org/openwrt/packages@19524 3c298f89-4303-0410-b956-a3cf2f4a3e73
2010-02-04 14:52:04 +00:00

28 lines
598 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"
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)
}