2017-02-22 10:55:24 +01:00
|
|
|
#!/sbin/openrc-run
|
|
|
|
# Copyright 1999-2017 Gentoo Foundation
|
2011-07-05 23:19:40 +02:00
|
|
|
# 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}
|
2011-07-05 23:19:40 +02:00
|
|
|
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
|
2012-04-12 17:09:45 +02:00
|
|
|
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}
|
2011-07-05 23:19:40 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
depend() {
|
2011-07-19 13:31:40 +02:00
|
|
|
need net
|
2012-04-13 13:40:20 +02:00
|
|
|
if [ $SVCNAME = "shinken" ]; then
|
|
|
|
need ${SHINKENSERVICES}
|
|
|
|
fi
|
2011-07-05 23:19:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
2011-07-11 13:01:38 +02:00
|
|
|
if [ $SVCNAME = "shinken" ]; then
|
2017-02-22 10:55:24 +01:00
|
|
|
ebegin "all shinken-services started"
|
2011-07-11 13:01:38 +02:00
|
|
|
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
|
2011-07-11 13:01:38 +02:00
|
|
|
eend $?
|
2011-07-05 23:19:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2011-07-11 13:01:38 +02:00
|
|
|
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}
|
2011-07-05 23:19:40 +02:00
|
|
|
eend $?
|
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
2017-02-22 10:55:24 +01:00
|
|
|
/usr/bin/shinken-arbiter -v --config="${ARBITERCFG}" \
|
|
|
|
--config="${SHINKENCFG}" $DEBUGCMD 2>&1
|
2011-07-05 23:19:40 +02:00
|
|
|
return $?
|
|
|
|
}
|
2012-04-13 13:40:20 +02:00
|
|
|
|
|
|
|
# vim: filetype=gentoo-init-d sw=2 ts=2 sts=2 noet:
|