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.
gentoo-overlay/net-analyzer/nsca/files/nsca.init

34 lines
645 B

#!/sbin/openrc-run
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
: ${CFGFILE:=/etc/nagios/nsca.cfg}
get_config() {
[ -f ${CFGFILE} ] || return 1
sed -n -e 's:^[ \t]*'$1'=\([^#]\+\).*:\1:p' \
${CFGFILE}
}
extra_started_commands="reload"
command=/usr/libexec/${SVCNAME}
command_args="-c ${CFGFILE} --daemon"
pidfile=$(get_config pid_file)
depend() {
config ${CFGFILE}
case $(get_config nsca_user) in
icinga) need icinga ;;
nagios) need nagios ;;
esac
}
reload() {
ebegin "Reloading ${SVCNAME}"
kill -HUP `cat $(get_config pid_file)`
eend $?
}