From: "Matt Thode" <prometheanfire@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/icinga2/, net-analyzer/icinga2/files/
Date: Sat, 21 Jul 2018 21:24:52 +0000 (UTC) [thread overview]
Message-ID: <1532208278.9179024f51643e2909a6d84049e69f887eabd9f9.prometheanfire@gentoo> (raw)
commit: 9179024f51643e2909a6d84049e69f887eabd9f9
Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 21 21:24:03 2018 +0000
Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org>
CommitDate: Sat Jul 21 21:24:38 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9179024f
net-analyzer/icinga2: 2.9.0-r1 fix init script
Closes: https://bugs.gentoo.org/661490
Package-Manager: Portage-2.3.43, Repoman-2.3.10
net-analyzer/icinga2/files/icinga2.initd-2 | 91 ++++++++++++++++++++++
...cinga2-2.9.0.ebuild => icinga2-2.9.0-r1.ebuild} | 2 +-
net-analyzer/icinga2/icinga2-9999.ebuild | 2 +-
3 files changed, 93 insertions(+), 2 deletions(-)
diff --git a/net-analyzer/icinga2/files/icinga2.initd-2 b/net-analyzer/icinga2/files/icinga2.initd-2
new file mode 100644
index 00000000000..b12716d4d44
--- /dev/null
+++ b/net-analyzer/icinga2/files/icinga2.initd-2
@@ -0,0 +1,91 @@
+#!/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
+}
diff --git a/net-analyzer/icinga2/icinga2-2.9.0.ebuild b/net-analyzer/icinga2/icinga2-2.9.0-r1.ebuild
similarity index 98%
rename from net-analyzer/icinga2/icinga2-2.9.0.ebuild
rename to net-analyzer/icinga2/icinga2-2.9.0-r1.ebuild
index 3085070c612..5911a041405 100644
--- a/net-analyzer/icinga2/icinga2-2.9.0.ebuild
+++ b/net-analyzer/icinga2/icinga2-2.9.0-r1.ebuild
@@ -107,7 +107,7 @@ src_install() {
einstalldocs
- newinitd "${FILESDIR}"/icinga2.initd icinga2
+ newinitd "${FILESDIR}"/icinga2.initd-2 icinga2
if use mysql ; then
docinto schema
diff --git a/net-analyzer/icinga2/icinga2-9999.ebuild b/net-analyzer/icinga2/icinga2-9999.ebuild
index 3085070c612..5911a041405 100644
--- a/net-analyzer/icinga2/icinga2-9999.ebuild
+++ b/net-analyzer/icinga2/icinga2-9999.ebuild
@@ -107,7 +107,7 @@ src_install() {
einstalldocs
- newinitd "${FILESDIR}"/icinga2.initd icinga2
+ newinitd "${FILESDIR}"/icinga2.initd-2 icinga2
if use mysql ; then
docinto schema
next reply other threads:[~2018-07-21 21:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-21 21:24 Matt Thode [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-10-16 11:49 [gentoo-commits] repo/gentoo:master commit in: net-analyzer/icinga2/, net-analyzer/icinga2/files/ Louis Sautier
2017-09-26 16:53 Matt Thode
2017-08-31 16:55 Matt Thode
2016-05-22 22:59 Matt Thode
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1532208278.9179024f51643e2909a6d84049e69f887eabd9f9.prometheanfire@gentoo \
--to=prometheanfire@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox