#!/sbin/openrc-run
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

extra_commands="reload"

command="/usr/sbin/keepalived"
command_args="${KEEPALIVED_OPTS}"
pidfile="/run/keepalived.pid"
required_files="/etc/keepalived/keepalived.conf"

depend() {
	use logger
	# The interfaces do not actually need to exist to start,
	# it handles them gracefully.
	use net
}

reload() {
	ebegin "Reloading keepalived.conf"
	start-stop-daemon --pidfile $pidfile --signal HUP
	eend $?
}
