* [gentoo-commits] gentoo-x86 commit in net-analyzer/icinga2/files: icinga2.initd icinga2-2.2.1-create_var_cache.patch icinga2.confd
@ 2014-12-14 23:27 Matt Thode (prometheanfire)
0 siblings, 0 replies; only message in thread
From: Matt Thode (prometheanfire) @ 2014-12-14 23:27 UTC (permalink / raw
To: gentoo-commits
prometheanfire 14/12/14 23:27:21
Modified: icinga2.initd icinga2.confd
Added: icinga2-2.2.1-create_var_cache.patch
Log:
fixing init script, thanks Feandil :D bug 532582
(Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 0x2471eb3e40ac5ac3)
Revision Changes Path
1.3 net-analyzer/icinga2/files/icinga2.initd
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/icinga2/files/icinga2.initd?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/icinga2/files/icinga2.initd?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/icinga2/files/icinga2.initd?r1=1.2&r2=1.3
Index: icinga2.initd
===================================================================
RCS file: /var/cvsroot/gentoo-x86/net-analyzer/icinga2/files/icinga2.initd,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- icinga2.initd 12 Dec 2014 16:47:44 -0000 1.2
+++ icinga2.initd 14 Dec 2014 23:27:21 -0000 1.3
@@ -2,10 +2,11 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-DAEMON=/usr/sbin/icinga2
-ICINGA2_CONFIG_FILE=/etc/icinga2/icinga2.conf
-ICINGA2_RUN_DIR=/var/run
-ICINGA2_STATE_DIR=/var
+DAEMON="/usr/sbin/icinga2"
+ICINGA2_CONFIG_FILE="/etc/icinga2/icinga2.conf"
+ICINGA2_RUN_DIR="/run/icinga2"
+ICINGA2_STATE_DIR="/var/cache/icinga2"
+ICINGA2_CMD_DIR="${ICINGA2_RUN_DIR}/cmd"
ICINGA2_PID_FILE="${ICINGA2_RUN_DIR}/icinga2/icinga2.pid"
ICINGA2_DAEMON_ARGS="daemon -c $ICINGA2_CONFIG_FILE -e $ICINGA2_ERROR_LOG -d"
@@ -18,12 +19,27 @@
ewarn "Config file '$ICINGA2_CONFIG_FILE' does not exist."
eend 1
fi
+
+ ICINGA2_USER=`$DAEMON variable get --current RunAsUser`
+ ICINGA2_GROUP=`$DAEMON variable get --current RunAsGroup`
+
+ checkpath -d -m 0750 -o $ICINGA2_USER:$ICINGA2_GROUP $ICINGA2_RUN_DIR
+ checkpath -d -m 0750 -o $ICINGA2_USER:$ICINGA2_COMMAND_GROUP $ICINGA2_STATE_DIR
+ checkpath -d -m 2750 -o $ICINGA2_USER:$ICINGA2_COMMAND_GROUP $ICINGA2_CMD_DIR
+
+ if ! $DAEMON daemon -c $ICINGA2_CONFIG_FILE -C > $ICINGA2_STARTUP_LOG 2>&1; then
+ eerror "Icinga 2 detected configuration errors. Check '$ICINGA2_STARTUP_LOG' for details."
+ return 1
+ fi
}
start() {
- checkconfig
+ checkconfig || return 1
+
ebegin "Starting icinga2"
- $DAEMON $ICINGA2_DAEMON_ARGS > $ICINGA2_STARTUP_LOG 2>&1
+ 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."
1.3 net-analyzer/icinga2/files/icinga2.confd
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/icinga2/files/icinga2.confd?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/icinga2/files/icinga2.confd?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/icinga2/files/icinga2.confd?r1=1.2&r2=1.3
Index: icinga2.confd
===================================================================
RCS file: /var/cvsroot/gentoo-x86/net-analyzer/icinga2/files/icinga2.confd,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- icinga2.confd 12 Dec 2014 16:47:44 -0000 1.2
+++ icinga2.confd 14 Dec 2014 23:27:21 -0000 1.3
@@ -1,6 +1,3 @@
ICINGA2_ERROR_LOG=/var/log/icinga2/error.log
ICINGA2_STARTUP_LOG=/var/log/icinga2/startup.log
ICINGA2_LOG=/var/log/icinga2/icinga2.log
-
-ICINGA2_COMMAND_USER=icinga
-ICINGA2_COMMAND_GROUP=icingacmd
1.1 net-analyzer/icinga2/files/icinga2-2.2.1-create_var_cache.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/icinga2/files/icinga2-2.2.1-create_var_cache.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/icinga2/files/icinga2-2.2.1-create_var_cache.patch?rev=1.1&content-type=text/plain
Index: icinga2-2.2.1-create_var_cache.patch
===================================================================
--- a/etc/initsystem/prepare-dirs
+++ b/etc/initsystem/prepare-dirs
@@ -31,3 +31,7 @@
mkdir -p $ICINGA2_RUN_DIR/icinga2/cmd
chown $ICINGA2_USER:$ICINGA2_COMMAND_GROUP $ICINGA2_RUN_DIR/icinga2/cmd
chmod 2750 $ICINGA2_RUN_DIR/icinga2/cmd
+
+mkdir -p $ICINGA2_STATE_DIR/cache/icinga2
+chown $ICINGA2_USER:$ICINGA2_COMMAND_GROUP $ICINGA2_STATE_DIR/cache/icinga2
+chmod 750 $ICINGA2_STATE_DIR/cache/icinga2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-12-14 23:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-14 23:27 [gentoo-commits] gentoo-x86 commit in net-analyzer/icinga2/files: icinga2.initd icinga2-2.2.1-create_var_cache.patch icinga2.confd Matt Thode (prometheanfire)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox