69 lines
1.6 KiB
Plaintext
69 lines
1.6 KiB
Plaintext
#!/sbin/openrc-run
|
|
# Copyright 1999-2017 Gentoo Foundation
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
# $Header: $
|
|
|
|
MODULE="xxMODULExx"
|
|
PIDPATH=${PIDPATH:-/var/run/shinken}
|
|
PIDFILE=${PIDPATH}/${MODULE}
|
|
|
|
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"
|
|
|
|
if [ -r "${XXUMODXXCFG}" ] ; then
|
|
tmppid=`grep 'pidfile=' ${XXUMODXXCFG} | grep -v '#' | tail -n 1 | awk -F '=' '{print $2}'`
|
|
XXUMODXXPID=${tmppid:-$XXUMODXXPID}
|
|
fi
|
|
|
|
depend() {
|
|
need net
|
|
if [ $SVCNAME = "shinken" ]; then
|
|
need ${SHINKENSERVICES}
|
|
fi
|
|
}
|
|
|
|
start() {
|
|
if [ $SVCNAME = "shinken" ]; then
|
|
ebegin "all shinken-services started"
|
|
return 0
|
|
fi
|
|
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
|
|
ebegin "Stopping shinken xxMODULExx"
|
|
start-stop-daemon --stop --exec /usr/bin/shinken-xxMODULExx --quiet \
|
|
--pidfile ${XXUMODXXPID}
|
|
eend $?
|
|
}
|
|
|
|
check() {
|
|
/usr/bin/shinken-arbiter -v --config="${ARBITERCFG}" \
|
|
--config="${SHINKENCFG}" $DEBUGCMD 2>&1
|
|
return $?
|
|
}
|
|
|
|
# vim: filetype=gentoo-init-d sw=2 ts=2 sts=2 noet:
|