aports/testing/keepalived/keepalived.initd
Sören Tempel 3e795e3ccc testing/keepalived: upgrade to 1.2.19
Also use new OpenRC services from Gentoo Linux.
2016-01-09 22:22:02 +01:00

34 lines
792 B
Plaintext
Executable File

#!/sbin/openrc-run
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
depend() {
use logger
# The interfaces do not actually need to exist to start, it handles them gracefully.
use net
}
command="/usr/sbin/keepalived"
command_args="${KEEPALIVED_OPTS}"
pidfile="/var/run/keepalived.pid"
extra_commands="checkconfig reload"
checkconfig() {
# keepalived has a config check command, but it does not work while the daemon is running!
if [ ! -e /etc/keepalived/keepalived.conf ] ; then
eerror "You need an /etc/keepalived/keepalived.conf file to run keepalived"
return 1
fi
}
start_pre() {
checkconfig || return 1
}
reload() {
ebegin "Reloading keepalived.conf"
start-stop-daemon --pidfile $pidfile --signal HUP
eend $?
}