summaryrefslogtreecommitdiffstats
path: root/network/keepalived/rc.keepalived
diff options
context:
space:
mode:
author Marek Wodzinski <majek@w7i.pl>2020-04-22 00:51:20 +0200
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2020-04-24 08:16:35 +0700
commit0782d45ca03548b01aee847e8683b9ff3d6ce481 (patch)
tree084f1a7d8d54bb9001e4a8bec674d154ac1c528f /network/keepalived/rc.keepalived
parent034ea3e2859d36fa837ab617c26870020c4c53f7 (diff)
downloadslackbuilds-0782d45ca03548b01aee847e8683b9ff3d6ce481.tar.gz
slackbuilds-0782d45ca03548b01aee847e8683b9ff3d6ce481.tar.xz
network/keepalived: Updated for version 2.0.20.
- update to newest version - disabled nftables support as it doesn't compile on 14.2 - removed dependency of optional sysvinit-functions and simplified rc.keepalived - moved daemon configuration to /etc/default Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/keepalived/rc.keepalived')
-rw-r--r--network/keepalived/rc.keepalived58
1 files changed, 15 insertions, 43 deletions
diff --git a/network/keepalived/rc.keepalived b/network/keepalived/rc.keepalived
index 8e214e651ac..fc063fa1fe6 100644
--- a/network/keepalived/rc.keepalived
+++ b/network/keepalived/rc.keepalived
@@ -3,48 +3,31 @@
# 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.2.2/init.keepalived
+# Slackware.
#
-# This version was modified by Nilton Moura, the author of
-# the SlackBuild Script for keepalived.
-
-# Source function library
-. /etc/rc.d/init.d/functions
+# This version was modified in 2010 by Nilton Moura,
+# the original author of the SlackBuild Script for keepalived.
+#
+# Sript simplified, removed dependency of optional sysvinit-functions
+# package and moved daemon options to /etc/default
+# in 2020 by Marek Wodzinski <majek@w7i.pl>
# Source configuration file (we set KEEPALIVED_OPTIONS there)
-. /etc/keepalived/keepalived
-
-RETVAL=0
-
-prog="keepalived"
+. /etc/default/keepalived
start() {
- echo -n $"Starting $prog: "
- daemon keepalived ${KEEPALIVED_OPTIONS}
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
+ echo "Starting keepalived"
+ /usr/sbin/keepalived ${KEEPALIVED_OPTIONS}
}
stop() {
- echo -n $"Stopping $prog: "
- killproc keepalived
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
+ echo "Stopping keepalived "
+ pkill -TERM keepalived 1>/dev/null 2>/dev/null
}
reload() {
- echo -n $"Reloading $prog: "
- killproc keepalived -1
- RETVAL=$?
- echo
+ echo "Reloading keepalived"
+ pkill -1 keepalived
}
# See how we were called.
@@ -62,18 +45,7 @@ case "$1" in
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}"
+ echo "Usage: $0 {start|stop|reload|restart}"
exit 1
esac
-
-exit $RETVAL