alpha-quadrant/net-analyzer/shinken/files/shinken.initd

69 lines
1.6 KiB
Plaintext
Raw Normal View History

2017-02-22 10:55:24 +01:00
#!/sbin/openrc-run
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
2017-02-22 10:55:24 +01:00
MODULE="xxMODULExx"
2011-07-19 14:03:05 +02:00
PIDPATH=${PIDPATH:-/var/run/shinken}
PIDFILE=${PIDPATH}/${MODULE}
2017-02-22 10:55:24 +01:00
source /etc/conf.d/shinken
SHINKENUSER=${SHINKENUSER:-shinken}
SHINKENGROUP=${SHINKENGROUP:-shinken}
export LANG=en_US.UTF8
export LC_ALL=en_US.UTF8
export PYTHONIOENCODING=utf8
export PYTHONUNBUFFERED="0"
export TZ=:/etc/localtime
# also unset http proxy, because pycurl is using it and this is bad, very bad :)
unset http_proxy
unset https_proxy
extra_commands="check"
2017-02-22 10:55:24 +01:00
if [ -r "${XXUMODXXCFG}" ] ; then
tmppid=`grep 'pidfile=' ${XXUMODXXCFG} | grep -v '#' | tail -n 1 | awk -F '=' '{print $2}'`
XXUMODXXPID=${tmppid:-$XXUMODXXPID}
fi
depend() {
need net
2012-04-13 13:40:20 +02:00
if [ $SVCNAME = "shinken" ]; then
need ${SHINKENSERVICES}
fi
}
start() {
if [ $SVCNAME = "shinken" ]; then
2017-02-22 10:55:24 +01:00
ebegin "all shinken-services started"
return 0
fi
2017-02-22 10:55:24 +01:00
ebegin "Starting shinken xxMODULExx"
## --user ${SHINKENUSER}:${SHINKENGROUP} \
start-stop-daemon --start \
--exec /usr/bin/shinken-xxMODULExx --quiet \
--pidfile ${XXUMODXXPID} -- --config=${XXUMODXXCFG} --daemon
eend $?
}
stop() {
if [ $SVCNAME = "shinken" ]; then
ebegin "all shinken-services stopped"
return 0
fi
2017-02-22 10:55:24 +01:00
ebegin "Stopping shinken xxMODULExx"
start-stop-daemon --stop --exec /usr/bin/shinken-xxMODULExx --quiet \
--pidfile ${XXUMODXXPID}
eend $?
}
check() {
2017-02-22 10:55:24 +01:00
/usr/bin/shinken-arbiter -v --config="${ARBITERCFG}" \
--config="${SHINKENCFG}" $DEBUGCMD 2>&1
return $?
}
2012-04-13 13:40:20 +02:00
# vim: filetype=gentoo-init-d sw=2 ts=2 sts=2 noet: