packages/net/haproxy/files/haproxy.init
nico ac37eb2674 packages/haproxy: use new service functions
git-svn-id: svn://svn.openwrt.org/openwrt/packages@29097 3c298f89-4303-0410-b956-a3cf2f4a3e73
2011-11-14 02:38:47 +00:00

25 lines
493 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2009-2010 OpenWrt.org
START=99
STOP=80
SERVICE_USE_PID=1
HAPROXY_BIN="/usr/sbin/haproxy"
HAPROXY_CONFIG="/etc/haproxy.cfg"
HAPROXY_PID="/var/run/haproxy.pid"
start() {
service_start $HAPROXY_BIN -q -D -f "$HAPROXY_CONFIG" -p "$HAPROXY_PID"
}
stop() {
$HAPROXY_BIN -q -f $HAPROXY_CONFIG -p $HAPROXY_PID -st $(cat $HAPROXY_PID)
service_stop $HAPROXY_BIN
}
reload() {
$HAPROXY_BIN -q -f $HAPROXY_CONFIG -p $HAPROXY_PID -sf $(cat $HAPROXY_PID)
}