aboutsummaryrefslogtreecommitdiff
path: root/network/keepalived/rc.keepalived
diff options
context:
space:
mode:
authorNilton Moura <nmoura@nmoura.eti.br>2010-09-09 10:48:20 -0400
committerdsomero <xgizzmo@slackbuilds.org>2010-09-09 10:48:20 -0400
commit7d5ffabc4dd36157ffce5ed8f57a38bfb4307350 (patch)
tree8f74b1d4197a2cd60ceb0ecfe3d1dea4be7e7ad1 /network/keepalived/rc.keepalived
parentda87ad250c8ef9600cd69b419a1f241770303423 (diff)
network/keepalived: Added (HealthChecking for LVS & HA cluters)
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'network/keepalived/rc.keepalived')
-rw-r--r--network/keepalived/rc.keepalived79
1 files changed, 79 insertions, 0 deletions
diff --git a/network/keepalived/rc.keepalived b/network/keepalived/rc.keepalived
new file mode 100644
index 0000000000000..808fd1b516135
--- /dev/null
+++ b/network/keepalived/rc.keepalived
@@ -0,0 +1,79 @@
+#!/bin/sh
+#
+# Startup script for the Keepalived daemon
+#
+# This is the modified version from the original for the
+# Slackware. The only thing that differs from the original
+# is the path of the Source configuration file. Before was
+# /etc/sysconfig and now is /etc/keepalived, and the header
+# for the update-rc.d of Debian was removed.
+#
+# The original file was copied to
+# /usr/doc/keepalived-1.1.20/init.keepalived
+#
+# This version was modified by Nilton Moura, the author of
+# the SlackBuild Script for keepalived.
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Source configuration file (we set KEEPALIVED_OPTIONS there)
+. /etc/keepalived/keepalived
+
+RETVAL=0
+
+prog="keepalived"
+
+start() {
+ echo -n $"Starting $prog: "
+ daemon keepalived ${KEEPALIVED_OPTIONS}
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc keepalived
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
+}
+
+reload() {
+ echo -n $"Reloading $prog: "
+ killproc keepalived -1
+ RETVAL=$?
+ echo
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ reload)
+ reload
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/$prog ]; then
+ stop
+ start
+ fi
+ ;;
+ status)
+ status keepalived
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|reload|restart|condrestart|status}"
+ exit 1
+esac
+
+exit $RETVAL