Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/plugins/keepalived/init.d/keepalived.tpl

79 lines
1.4 KiB

2 years ago
#!/bin/sh
#
# Startup script for the Keepalived daemon
#
# processname: keepalived
# pidfile: /var/run/keepalived.pid
# config: /etc/keepalived/keepalived.conf
# chkconfig: - 21 79
# description: Start and stop Keepalived
2 years ago
# Source function library
if [ -f /etc/rc.d/init.d/functions ];then
. /etc/rc.d/init.d/functions
fi
2 years ago
SYS_KP_FILE={$SERVER_PATH}/keepalived/etc/sysconfig/keepalived
# Source configuration file (we set KEEPALIVED_OPTIONS there)
if [ -f $SYS_KP_FILE ];then
2 years ago
. $SYS_KP_FILE
fi
2 years ago
RETVAL=0
prog="keepalived"
2 years ago
start() {
echo -n $"Starting $prog: "
2 years ago
{$SERVER_PATH}/keepalived/sbin/keepalived ${KEEPALIVED_OPTIONS}
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
2 years ago
}
stop() {
echo -n $"Stopping $prog: "
2 years ago
pkill keepalived
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
2 years ago
}
reload() {
echo -n $"Reloading $prog: "
2 years ago
pkill keepalived -1
RETVAL=$?
echo
}
2 years ago
# See how we were called.
2 years ago
case "$1" in
start)
start
2 years ago
;;
stop)
stop
2 years ago
;;
reload)
reload
;;
restart)
stop
start
2 years ago
;;
condrestart)
if [ -f /var/lock/subsys/$prog ]; then
stop
start
fi
;;
status)
status keepalived
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|reload|restart|condrestart|status}"
RETVAL=1
2 years ago
esac
exit $RETVAL