[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
This commit is contained in:
26
net/haproxy/files/haproxy.init
Normal file
26
net/haproxy/files/haproxy.init
Normal file
@ -0,0 +1,26 @@
|
||||
#!/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)
|
||||
}
|
Reference in New Issue
Block a user