commit 58bad708c5277045c7ad9192d2a049500544df71
Author: Elan Ruusamäe <[email protected]>
Date:   Tue Jan 3 07:02:52 2017 +0200

    sysvinit: add pidfile variable

 haproxy.init | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/haproxy.init b/haproxy.init
index 070d453..20d16bd 100755
--- a/haproxy.init
+++ b/haproxy.init
@@ -27,6 +27,8 @@ else
        exit 0
 fi
 
+pidfile="/var/run/haproxy.pid"
+
 # configtest itself
 # must return non-zero if check failed
 # output is discarded if checkconfig is ran without details
@@ -71,7 +73,7 @@ start() {
        fi
 
        msg_starting "HA-Proxy"
-       daemon /usr/sbin/haproxy -D -f /etc/haproxy/haproxy.cfg -p 
/var/run/haproxy.pid
+       daemon /usr/sbin/haproxy -D -f /etc/haproxy/haproxy.cfg -p $pidfile
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/haproxy
 }
@@ -83,11 +85,12 @@ stop() {
        fi
 
        msg_stopping "HA-Proxy"
-       killproc --pidfile /var/run/haproxy.pid haproxy
+       killproc --pidfile $pidfile haproxy
        rm -f /var/lock/subsys/haproxy
 }
 
 reload() {
+       local pid
        if [ ! -f /var/lock/subsys/haproxy ]; then
                msg_not_running "HA-Proxy"
                RETVAL=7
@@ -96,7 +99,8 @@ reload() {
 
        checkconfig
        msg_reloading "HA-Proxy"
-       daemon /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p 
/var/run/haproxy.pid -st $(</var/run/haproxy.pid)
+       pid=$(cat $pidfile)
+       daemon /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p $pidfile -st 
$pid
        RETVAL=$?
 }
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/haproxy.git/commitdiff/58bad708c5277045c7ad9192d2a049500544df71

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to