1196b80904
git-svn-id: svn://svn.openwrt.org/openwrt/packages@19126 3c298f89-4303-0410-b956-a3cf2f4a3e73
27 lines
530 B
Bash
27 lines
530 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 -b -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)
|
|
}
|