packages/net/haproxy/files/haproxy.init
jow f0b48001e1 [packages] add HAProxy, a high performance HTTP/TCP reverse proxy and load balancer - thanks Thomas Heil <heil@terminal-consulting.de>
git-svn-id: svn://svn.openwrt.org/openwrt/packages@18880 3c298f89-4303-0410-b956-a3cf2f4a3e73
2009-12-21 20:58:46 +00:00

27 lines
527 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2009 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 -d -p "$HAPROXY_PID"
}
stop() {
start-stop-daemon -K -x $HAPROXY_BIN -p $HAPROXY_PID
rm -f $HAPROXY_PID
}
reload() {
[ ! -f "$HAPROXY_PID" ] && start
$HAPROXY_BIN -f $HAPROXY_CONFIG -p $HAPROXY_PID -st $(cat $HAPROXY_PID)
}