5
# Required-Start: $remote_fs $syslog
6
# Required-Stop : $remote_fs $syslog
8
# Default-Stop : 0 1 2 6
9
# Description : Start keepalived to allow XY and provide YZ
10
# continued on second line by '#<TAB>'
14
DAEMON="Keepalived daemon"
15
DAEMON_BIN="/usr/local/sbin/keepalived"
16
DAEMON_CONF="/etc/keepalived/keepalived.conf"
17
DAEMON_PIDFILE="/var/run/keepalived.pid"
21
# "yes" if exist next values in freshclam.conf
22
# PidFile /var/run/keepalived.pid
25
pid_par=${DAEMON_PIDFILE:+"-p $DAEMON_PIDFILE"}
26
usr_par=${DAEMON_USER:+"-u $DAEMON_USER"}
28
test -x $DAEMON_BIN || exit 5
30
# Shell functions sourced from /etc/rc.status:
31
# rc_check check and set local and overall rc status
32
# rc_status check and set local and overall rc status
33
# rc_status -v ditto but be verbose in local rc status
34
# rc_status -v -r ditto and clear the local rc status
35
# rc_failed set local and overall rc status to failed
36
# rc_failed <num> set local and overall rc status to <num><num>
37
# rc_reset clear local rc status (overall remains)
38
# rc_exit exit appropriate to overall rc status
41
# First reset status of this service
44
# Return values acc. to LSB for all commands but status:
46
# 1 - generic or unspecified error
47
# 2 - invalid or excess argument(s)
48
# 3 - unimplemented feature (e.g. "reload")
49
# 4 - insufficient privilege
50
# 5 - program is not installed
51
# 6 - program is not configured
52
# 7 - program is not running
54
# Note that starting an already running service, stopping
55
# or restarting a not-running service as well as the restart
56
# with force-reload (in case signalling is not supported) are
57
# considered a success.
59
# remove empty pid files to avoid disturbing warnings by checkproc/killproc
60
# (these can occur if dhcpd does not start correctly)
61
test -e $DAEMON_PIDFILE && ! test -s $DAEMON_PIDFILE && rm $DAEMON_PIDFILE
65
echo -n "Starting $DAEMON "
66
if test ! -f ${DAEMON_CONF}; then
67
echo -n >&2 "Configuration file, ${DAEMON_CONF} does not exist. "
71
checkproc $pid_par ${DAEMON_BIN}
73
0) echo -n "- Warning: daemon already running. " ;;
74
1) echo -n "- Warning: ${DAEMON_PIDFILE} exists. " ;;
76
# echo "startproc $usr_par $pid_par ${DAEMON_BIN} ${DAEMON_OPT}"
77
startproc $usr_par $pid_par ${DAEMON_BIN} ${DAEMON_OPT}
81
echo -n "Shutting down $DAEMON "
82
checkproc $pid_par ${DAEMON_BIN} || \
83
echo -n " Warning: daemon not running. "
84
killproc $pid_par -t 10 ${DAEMON_BIN}
87
try-restart|condrestart)
88
if test "$1" = "condrestart"; then
89
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
105
if test "$SUPPORTS_HUP" = "yes"; then
106
echo -n "Reload service $DAEMON "
107
checkproc $pid_par ${DAEMON_BIN} && \
108
touch ${DAEMON_PIDFILE} || \
109
echo -n >&2 " Warning: daemon not running. "
110
killproc $pid_par -HUP ${DAEMON_BIN}
113
$0 stop && sleep 3 && $0 start
118
echo -n "Checking for $DAEMON "
119
checkproc $pid_par ${DAEMON_BIN}
123
test ${DAEMON_CONF} -nt ${DAEMON_PIDFILE} && echo reload
126
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"