alpha-quadrant/net-analyzer/shinken/files/shinken.initd
2011-07-05 23:19:40 +02:00

44 lines
1.0 KiB
Plaintext

#!/sbin/runscript
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
MODULE=${SVCNAME#*.}
_MODULE=$(echo $MODULE | awk '{print toupper($0)}')
SHINKEN=/usr/bin/shinken
PIDPATH=/var/run/shinken
PIDFILE=${PIDPATH}/${MODULE}
LANG=en_US.UTF8
opts="${opts} check"
eval DEBUGFILE="\${${_MODULE}DEBUGFILE}"
eval CONFIGFILE="\${${_MODULE}CFG}"
eval PIDFILE="\${${_MODULE}PID}"
SHINKENM="/usr/bin/shinken-${MODULE}"
if [ $MODULE = "arbiter" ]; then
CONFIGFILE="${CONFIGFILE} -c ${SHINKENSPECIFICCFG}"
fi
depend() {
need net
}
start() {
ebegin "${SVCNAME} ${MODULE} ${PIDFILE}"
start-stop-daemon --start --exec ${SHINKENM} --pidfile "${PIDFILE}" \
-- --config ${CONFIGFILE} --daemon
}
stop() {
local X RETVAL=0
ebegin "Stopping shinken application ${MODULE}"
start-stop-daemon --stop --exec ${SHINKENM} --pidfile ${PIDFILE}
eend $?
}
check() {
"$BIN/shinken-arbiter" -v -c "$SHINKENCFG" -c "$SHINKENSPECIFICCFG" $DEBUGCMD 2>&1
return $?
}