From: Nicolas Thill Date: Mon, 14 Nov 2011 02:38:47 +0000 (+0000) Subject: packages/haproxy: use new service functions X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=6a695968b17998242141fa2cbeb71675f0af086d;p=openwrt%2Fsvn-archive%2Farchive.git packages/haproxy: use new service functions SVN-Revision: 29097 --- diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 205d6d305f..e8d9a36e9f 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2010 OpenWrt.org +# Copyright (C) 2010-2011 OpenWrt.org # Copyright (C) 2009-2010 Thomas Heil # # This is free software, licensed under the GNU General Public License v2. @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=haproxy PKG_VERSION:=1.4.18 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://haproxy.1wt.eu/download/1.4/src diff --git a/net/haproxy/files/haproxy.init b/net/haproxy/files/haproxy.init index 73a21e7830..1548e31dee 100644 --- a/net/haproxy/files/haproxy.init +++ b/net/haproxy/files/haproxy.init @@ -4,28 +4,21 @@ START=99 STOP=80 +SERVICE_USE_PID=1 + HAPROXY_BIN="/usr/sbin/haproxy" HAPROXY_CONFIG="/etc/haproxy.cfg" HAPROXY_PID="/var/run/haproxy.pid" -boot() { - - #Do nothing on boot - exit 0 -} - start() { - [ -x "$HAPROXY_BIN" ] || return 1 - - start-stop-daemon -S -x $HAPROXY_BIN -- \ - -f "$HAPROXY_CONFIG" -V -D -p "$HAPROXY_PID" + service_start $HAPROXY_BIN -q -D -f "$HAPROXY_CONFIG" -p "$HAPROXY_PID" } stop() { - service_kill ${HAPROXY_BIN##*/} $HAPROXY_PID - rm -f $HAPROXY_PID + $HAPROXY_BIN -q -f $HAPROXY_CONFIG -p $HAPROXY_PID -st $(cat $HAPROXY_PID) + service_stop $HAPROXY_BIN } reload() { - $HAPROXY_BIN -f $HAPROXY_CONFIG -D -V -p $HAPROXY_PID -sf $(cat $HAPROXY_PID) + $HAPROXY_BIN -q -f $HAPROXY_CONFIG -p $HAPROXY_PID -sf $(cat $HAPROXY_PID) }