diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-04-05 21:17:31 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-04-05 21:17:31 +0100 |
commit | dc7cbdfa65fd814b3b9aa3c56257da201109e807 (patch) | |
tree | c85d72f6f31f21f178069c9d41d41a7c1ff4b362 /net-analyzer/icinga2/files/icinga2.initd-2 | |
parent | 0706fc6986773f4e4d391deff4ad5143c464ea4e (diff) |
gentoo resync : 05.04.2019
Diffstat (limited to 'net-analyzer/icinga2/files/icinga2.initd-2')
-rw-r--r-- | net-analyzer/icinga2/files/icinga2.initd-2 | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/net-analyzer/icinga2/files/icinga2.initd-2 b/net-analyzer/icinga2/files/icinga2.initd-2 deleted file mode 100644 index b12716d4d446..000000000000 --- a/net-analyzer/icinga2/files/icinga2.initd-2 +++ /dev/null @@ -1,91 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -extra_started_commands="reload" - -# Set defaults, see /etc/conf.d/icinga2 to override -: ${DAEMON:=/usr/sbin/icinga2} -: ${ICINGA2_CONFIG_FILE:=/etc/icinga2/icinga2.conf} -: ${ICINGA2_RUN_DIR:=/run/icinga2} -: ${ICINGA2_STATE_DIR:=/var/cache/icinga2} -: ${ICINGA2_PID_FILE:=${ICINGA2_RUN_DIR}/icinga2.pid} -: ${ICINGA2_CMD_DIR:=${ICINGA2_RUN_DIR}/cmd} -: ${ICINGA2_LOG_DIR:=/var/log/icinga2} -: ${ICINGA2_ERROR_LOG:=/var/log/icinga2/error.log} -: ${ICINGA2_STARTUP_LOG:=/var/log/icinga2/startup.log} -: ${ICINGA2_LOG:=/var/log/icinga2/icinga2.log} -: ${ICINGA2_CACHE_DIR:=/var/cache/icinga2} -: ${ICINGA2_USER:=icinga} -: ${ICINGA2_GROUP:=icingacmd} -: ${ICINGA2_COMMAND_GROUP:=icingacmd} - -ICINGA2_DAEMON_ARGS="daemon -c $ICINGA2_CONFIG_FILE -e $ICINGA2_ERROR_LOG -d" - -depend() { - need net -} - -checkconfig() { - if [ ! -e "$ICINGA2_CONFIG_FILE" ]; then - ewarn "Config file '$ICINGA2_CONFIG_FILE' does not exist." - eend 1 - fi - - ICINGA2_USER=$($DAEMON variable get --current RunAsUser) - if [ $? != 0 ]; then - eerror "Could not fetch RunAsUser variable: '$ICINGA2_USER'." - return 1 - fi - ICINGA2_GROUP=$($DAEMON variable get --current RunAsGroup) - if [ $? != 0 ]; then - eerror "Could not fetch RunAsGroup variable: '$ICINGA2_GROUP'." - return 1 - fi - - checkpath -d -m 0750 -o $ICINGA2_USER:$ICINGA2_GROUP $ICINGA2_RUN_DIR - checkpath -d -m 0750 -o $ICINGA2_USER:$ICINGA2_GROUP $ICINGA2_STATE_DIR - checkpath -d -m 2750 -o $ICINGA2_USER:$ICINGA2_GROUP $ICINGA2_CMD_DIR - - if ! $DAEMON daemon -c $ICINGA2_CONFIG_FILE -C > $ICINGA2_STARTUP_LOG 2>&1; then - eerror "Icinga2 detected configuration errors. Check '$ICINGA2_STARTUP_LOG' for details." - return 1 - fi -} - -start() { - checkconfig || return 1 - - ebegin "Starting icinga2" - start-stop-daemon --start --exec "${DAEMON}" \ - --pidfile "${ICINGA2_PID_FILE}" \ - -- $ICINGA2_DAEMON_ARGS > $ICINGA2_STARTUP_LOG 2>&1 - local retval=$? - if [ $retval -ne 0 ]; then - ewarn "Error starting icinga2. '$ICINGA2_STARTUP_LOG' for details." - fi - eend $retval -} - -stop() { - ebegin "Stopping icinga2" - start-stop-daemon \ - --stop \ - --pidfile $ICINGA2_PID_FILE \ - --retry "SIGTERM/15 SIGKILL/30" \ - --progress - eend $? -} - -reload() { - checkconfig || return 1 - - ebegin "Reloading icinga2" - start-stop-daemon --signal HUP --pidfile "$ICINGA2_PID_FILE" - - local retval=$? - if [ $retval -ne 0 ]; then - ewarn "Error reloading icinga2." - fi - eend $retval -} |