summaryrefslogtreecommitdiffstats
path: root/network/haproxy/rc.haproxy
diff options
context:
space:
mode:
author Cherife Li2010-05-11 22:54:48 +0200
committer David Somero2010-05-11 22:54:48 +0200
commit57ffdc3d18412f405daec78eeefca32a12fb2e63 (patch)
tree880ff2fe1693127b762373d2e23095c24258d7cb /network/haproxy/rc.haproxy
parent0ee18f68bb6860a1b3cbf83658ee93def4196e3f (diff)
downloadslackbuilds-57ffdc3d18412f405daec78eeefca32a12fb2e63.tar.gz
network/haproxy: Added to 12.1 repository
Diffstat (limited to 'network/haproxy/rc.haproxy')
-rw-r--r--network/haproxy/rc.haproxy35
1 files changed, 35 insertions, 0 deletions
diff --git a/network/haproxy/rc.haproxy b/network/haproxy/rc.haproxy
new file mode 100644
index 0000000000..6f224d7f76
--- /dev/null
+++ b/network/haproxy/rc.haproxy
@@ -0,0 +1,35 @@
+#!/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>.
+#
+
+Bin=/usr/sbin/haproxy
+CfgFile=/etc/haproxy/haproxy.cfg
+PIDFile=/var/run/haproxy.pid
+
+case "$1" in
+ check)
+ echo "Checking HAProxy configuration file..."
+ $Bin -f $CfgFile -cV
+ ;;
+ start)
+ echo "Starting HAProxy..."
+ $Bin -f $CfgFile -D -p $PIDFile
+ ;;
+ stop)
+ echo "Shutting down HAProxy..."
+ kill -TERM `cat $PIDFile`
+ rm -f $PIDFile
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ *)
+ echo "usage $0 {check|start|stop|restart}"
+esac