1 |
commit: e66a341ec02cfbb13ac0875fd0c2ea55a1212f09 |
2 |
Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 14 18:38:17 2018 +0000 |
4 |
Commit: Matthew Thode <prometheanfire <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 14 18:40:01 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e66a341e |
7 |
|
8 |
net-analyzer/icinga2: update init script |
9 |
|
10 |
Closes: https://bugs.gentoo.org/668506 |
11 |
Signed-off-by: Matthew Thode <prometheanfire <AT> gentoo.org> |
12 |
Package-Manager: Portage-2.3.49, Repoman-2.3.11 |
13 |
|
14 |
net-analyzer/icinga2/files/icinga2.initd-3 | 91 ++++++++++++++++++++++ |
15 |
...nga2-2.10.0.ebuild => icinga2-2.10.0-r1.ebuild} | 2 +- |
16 |
net-analyzer/icinga2/icinga2-9999.ebuild | 4 +- |
17 |
3 files changed, 94 insertions(+), 3 deletions(-) |
18 |
|
19 |
diff --git a/net-analyzer/icinga2/files/icinga2.initd-3 b/net-analyzer/icinga2/files/icinga2.initd-3 |
20 |
new file mode 100644 |
21 |
index 00000000000..46990e3e4e2 |
22 |
--- /dev/null |
23 |
+++ b/net-analyzer/icinga2/files/icinga2.initd-3 |
24 |
@@ -0,0 +1,91 @@ |
25 |
+#!/sbin/openrc-run |
26 |
+# Copyright 1999-2018 Gentoo Authors |
27 |
+# Distributed under the terms of the GNU General Public License v2 |
28 |
+ |
29 |
+extra_started_commands="reload" |
30 |
+ |
31 |
+# Set defaults, see /etc/conf.d/icinga2 to override |
32 |
+: ${DAEMON:=/usr/sbin/icinga2} |
33 |
+: ${ICINGA2_CONFIG_FILE:=/etc/icinga2/icinga2.conf} |
34 |
+: ${ICINGA2_RUN_DIR:=/run/icinga2} |
35 |
+: ${ICINGA2_STATE_DIR:=/var/cache/icinga2} |
36 |
+: ${ICINGA2_PID_FILE:=${ICINGA2_RUN_DIR}/icinga2.pid} |
37 |
+: ${ICINGA2_CMD_DIR:=${ICINGA2_RUN_DIR}/cmd} |
38 |
+: ${ICINGA2_LOG_DIR:=/var/log/icinga2} |
39 |
+: ${ICINGA2_ERROR_LOG:=/var/log/icinga2/error.log} |
40 |
+: ${ICINGA2_STARTUP_LOG:=/var/log/icinga2/startup.log} |
41 |
+: ${ICINGA2_LOG:=/var/log/icinga2/icinga2.log} |
42 |
+: ${ICINGA2_CACHE_DIR:=/var/cache/icinga2} |
43 |
+: ${ICINGA2_USER:=icinga} |
44 |
+: ${ICINGA2_GROUP:=icingacmd} |
45 |
+: ${ICINGA2_COMMAND_GROUP:=icingacmd} |
46 |
+ |
47 |
+ICINGA2_DAEMON_ARGS="daemon -c $ICINGA2_CONFIG_FILE -e $ICINGA2_ERROR_LOG -d" |
48 |
+ |
49 |
+depend() { |
50 |
+ need net |
51 |
+} |
52 |
+ |
53 |
+checkconfig() { |
54 |
+ if [ ! -e "$ICINGA2_CONFIG_FILE" ]; then |
55 |
+ ewarn "Config file '$ICINGA2_CONFIG_FILE' does not exist." |
56 |
+ eend 1 |
57 |
+ fi |
58 |
+ |
59 |
+ ICINGA2_USER=$($DAEMON variable get RunAsUser) |
60 |
+ if [ $? != 0 ]; then |
61 |
+ eerror "Could not fetch RunAsUser variable: '$ICINGA2_USER'." |
62 |
+ return 1 |
63 |
+ fi |
64 |
+ ICINGA2_GROUP=$($DAEMON variable get RunAsGroup) |
65 |
+ if [ $? != 0 ]; then |
66 |
+ eerror "Could not fetch RunAsGroup variable: '$ICINGA2_GROUP'." |
67 |
+ return 1 |
68 |
+ fi |
69 |
+ |
70 |
+ checkpath -d -m 0750 -o $ICINGA2_USER:$ICINGA2_GROUP $ICINGA2_RUN_DIR |
71 |
+ checkpath -d -m 0750 -o $ICINGA2_USER:$ICINGA2_GROUP $ICINGA2_STATE_DIR |
72 |
+ checkpath -d -m 2750 -o $ICINGA2_USER:$ICINGA2_GROUP $ICINGA2_CMD_DIR |
73 |
+ |
74 |
+ if ! $DAEMON daemon -c $ICINGA2_CONFIG_FILE -C > $ICINGA2_STARTUP_LOG 2>&1; then |
75 |
+ eerror "Icinga2 detected configuration errors. Check '$ICINGA2_STARTUP_LOG' for details." |
76 |
+ return 1 |
77 |
+ fi |
78 |
+} |
79 |
+ |
80 |
+start() { |
81 |
+ checkconfig || return 1 |
82 |
+ |
83 |
+ ebegin "Starting icinga2" |
84 |
+ start-stop-daemon --start --exec "${DAEMON}" \ |
85 |
+ --pidfile "${ICINGA2_PID_FILE}" \ |
86 |
+ -- $ICINGA2_DAEMON_ARGS > $ICINGA2_STARTUP_LOG 2>&1 |
87 |
+ local retval=$? |
88 |
+ if [ $retval -ne 0 ]; then |
89 |
+ ewarn "Error starting icinga2. '$ICINGA2_STARTUP_LOG' for details." |
90 |
+ fi |
91 |
+ eend $retval |
92 |
+} |
93 |
+ |
94 |
+stop() { |
95 |
+ ebegin "Stopping icinga2" |
96 |
+ start-stop-daemon \ |
97 |
+ --stop \ |
98 |
+ --pidfile $ICINGA2_PID_FILE \ |
99 |
+ --retry "SIGTERM/15 SIGKILL/30" \ |
100 |
+ --progress |
101 |
+ eend $? |
102 |
+} |
103 |
+ |
104 |
+reload() { |
105 |
+ checkconfig || return 1 |
106 |
+ |
107 |
+ ebegin "Reloading icinga2" |
108 |
+ start-stop-daemon --signal HUP --pidfile "$ICINGA2_PID_FILE" |
109 |
+ |
110 |
+ local retval=$? |
111 |
+ if [ $retval -ne 0 ]; then |
112 |
+ ewarn "Error reloading icinga2." |
113 |
+ fi |
114 |
+ eend $retval |
115 |
+} |
116 |
|
117 |
diff --git a/net-analyzer/icinga2/icinga2-2.10.0.ebuild b/net-analyzer/icinga2/icinga2-2.10.0-r1.ebuild |
118 |
similarity index 98% |
119 |
rename from net-analyzer/icinga2/icinga2-2.10.0.ebuild |
120 |
rename to net-analyzer/icinga2/icinga2-2.10.0-r1.ebuild |
121 |
index e5caea793dd..913217ef694 100644 |
122 |
--- a/net-analyzer/icinga2/icinga2-2.10.0.ebuild |
123 |
+++ b/net-analyzer/icinga2/icinga2-2.10.0-r1.ebuild |
124 |
@@ -109,7 +109,7 @@ src_install() { |
125 |
|
126 |
einstalldocs |
127 |
|
128 |
- newinitd "${FILESDIR}"/icinga2.initd-2 icinga2 |
129 |
+ newinitd "${FILESDIR}"/icinga2.initd-3 icinga2 |
130 |
|
131 |
if use mysql ; then |
132 |
docinto schema |
133 |
|
134 |
diff --git a/net-analyzer/icinga2/icinga2-9999.ebuild b/net-analyzer/icinga2/icinga2-9999.ebuild |
135 |
index c0f291e4ea2..913217ef694 100644 |
136 |
--- a/net-analyzer/icinga2/icinga2-9999.ebuild |
137 |
+++ b/net-analyzer/icinga2/icinga2-9999.ebuild |
138 |
@@ -1,4 +1,4 @@ |
139 |
-# Copyright 1999-2018 Gentoo Foundation |
140 |
+# Copyright 1999-2018 Gentoo Authors |
141 |
# Distributed under the terms of the GNU General Public License v2 |
142 |
|
143 |
EAPI=6 |
144 |
@@ -109,7 +109,7 @@ src_install() { |
145 |
|
146 |
einstalldocs |
147 |
|
148 |
- newinitd "${FILESDIR}"/icinga2.initd-2 icinga2 |
149 |
+ newinitd "${FILESDIR}"/icinga2.initd-3 icinga2 |
150 |
|
151 |
if use mysql ; then |
152 |
docinto schema |