summaryrefslogtreecommitdiff
path: root/network/haproxy/rc.haproxy
diff options
context:
space:
mode:
Diffstat (limited to 'network/haproxy/rc.haproxy')
-rw-r--r--network/haproxy/rc.haproxy24
1 files changed, 10 insertions, 14 deletions
diff --git a/network/haproxy/rc.haproxy b/network/haproxy/rc.haproxy
index 6f224d7f76..5663cc37a1 100644
--- a/network/haproxy/rc.haproxy
+++ b/network/haproxy/rc.haproxy
@@ -1,35 +1,31 @@
#!/bin/sh
#
# HAProxy daemon control script.
-#
-# This is an init script for the haproxy daemon.
-# To use haproxy, you must first set up the config file(s).
-#
-# Written for Slackware Linux by Cherife Li <cherife@dotimes.com>.
-#
+# Written for Slackware Linux by Cherife Li <cherife-#-dotimes.com>.
-Bin=/usr/sbin/haproxy
-CfgFile=/etc/haproxy/haproxy.cfg
-PIDFile=/var/run/haproxy.pid
+BIN=/usr/sbin/haproxy
+CONF=/etc/haproxy/haproxy.cfg
+PID=/var/run/haproxy.pid
case "$1" in
check)
echo "Checking HAProxy configuration file..."
- $Bin -f $CfgFile -cV
+ $BIN -f $CONF -cV
;;
start)
echo "Starting HAProxy..."
- $Bin -f $CfgFile -D -p $PIDFile
+ $BIN -f $CONF -D -p $PID
;;
stop)
echo "Shutting down HAProxy..."
- kill -TERM `cat $PIDFile`
- rm -f $PIDFile
+ kill -TERM `cat $PID`
+ rm -f $PID &> /dev/null
;;
restart)
stop
+ sleep 2
start
;;
*)
- echo "usage $0 {check|start|stop|restart}"
+ echo "usage `basename $0` {check|start|stop|restart}"
esac