1 |
commit: c1983aebe66b95bd9da87d40db1f608ba90c7528 |
2 |
Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Apr 5 19:18:08 2022 +0000 |
4 |
Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jun 5 14:06:07 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1983aeb |
7 |
|
8 |
app-metrics/collectd: fix missing group in init script |
9 |
|
10 |
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org> |
11 |
Closes: https://github.com/gentoo/gentoo/pull/24922 |
12 |
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org> |
13 |
|
14 |
...-5.12.0-r6.ebuild => collectd-5.12.0-r7.ebuild} | 2 +- |
15 |
app-metrics/collectd/files/collectd.initd-r3 | 71 ++++++++++++++++++++++ |
16 |
2 files changed, 72 insertions(+), 1 deletion(-) |
17 |
|
18 |
diff --git a/app-metrics/collectd/collectd-5.12.0-r6.ebuild b/app-metrics/collectd/collectd-5.12.0-r7.ebuild |
19 |
similarity index 99% |
20 |
rename from app-metrics/collectd/collectd-5.12.0-r6.ebuild |
21 |
rename to app-metrics/collectd/collectd-5.12.0-r7.ebuild |
22 |
index 608f269fb2c6..1e9d0b18e23e 100644 |
23 |
--- a/app-metrics/collectd/collectd-5.12.0-r6.ebuild |
24 |
+++ b/app-metrics/collectd/collectd-5.12.0-r7.ebuild |
25 |
@@ -464,7 +464,7 @@ src_install() { |
26 |
keepdir /var/lib/${PN} |
27 |
fowners collectd:collectd /var/lib/${PN} |
28 |
|
29 |
- newinitd "${FILESDIR}/${PN}.initd-r2" ${PN} |
30 |
+ newinitd "${FILESDIR}/${PN}.initd-r3" ${PN} |
31 |
newconfd "${FILESDIR}/${PN}.confd-r2" ${PN} |
32 |
systemd_newunit "contrib/systemd.${PN}.service" ${PN}.service |
33 |
|
34 |
|
35 |
diff --git a/app-metrics/collectd/files/collectd.initd-r3 b/app-metrics/collectd/files/collectd.initd-r3 |
36 |
new file mode 100644 |
37 |
index 000000000000..aa3396d5a451 |
38 |
--- /dev/null |
39 |
+++ b/app-metrics/collectd/files/collectd.initd-r3 |
40 |
@@ -0,0 +1,71 @@ |
41 |
+#!/sbin/openrc-run |
42 |
+# Copyright 1999-2018 Gentoo Foundation |
43 |
+# Distributed under the terms of the GNU General Public License v2 |
44 |
+ |
45 |
+COLLECTD_CONFIGFILE=${COLLECTD_CONFIGFILE:-"/etc/collectd.conf"} |
46 |
+COLLECTD_PIDFILE=${COLLECTD_PIDFILE:-"/run/collectd.pid"} |
47 |
+COLLECTD_NICELEVEL=${COLLECTD_NICELEVEL:-5} |
48 |
+COLLECTD_USER=${COLLECTD_USER:-"collectd"} |
49 |
+COLLECTD_GROUP=${COLLECTD_GROUP:-"collectd"} |
50 |
+COLLECTD_SSDARGS=${COLLECTD_SSDARGS:-"--wait 1000"} |
51 |
+COLLECTD_TERMTIMEOUT=${COLLECTD_TERMTIMEOUT:-"TERM/25/KILL/5"} |
52 |
+COLLECTD_OPTS=${COLLECTD_OPTS:-""} |
53 |
+ |
54 |
+command="/usr/sbin/collectd" |
55 |
+command_args="${COLLECTD_OPTS} -C \"${COLLECTD_CONFIGFILE}\" -f" |
56 |
+command_background=true |
57 |
+command_group="${COLLECTD_GROUP}" |
58 |
+command_user="${COLLECTD_USER}" |
59 |
+start_stop_daemon_args="${COLLECTD_SSDARGS} --nice ${COLLECTD_NICELEVEL}" |
60 |
+pidfile="${COLLECTD_PIDFILE}" |
61 |
+retry="${COLLECTD_TERMTIMEOUT}" |
62 |
+ |
63 |
+extra_commands="configtest" |
64 |
+description_configtest="Run collectd's internal config check." |
65 |
+ |
66 |
+required_files="\"${COLLECTD_CONFIGFILE}\"" |
67 |
+ |
68 |
+depend() { |
69 |
+ use dns |
70 |
+} |
71 |
+ |
72 |
+_checkconfig() { |
73 |
+ if [ $(sed '/^$\|^#/d' "${COLLECTD_CONFIGFILE}" | grep 'LoadPlugin[[:space:]]\+oracle' | wc -l) -ge 1 ] ; then |
74 |
+ if [ -e /etc/env.d/50oracle-instantclient-basic ] ; then |
75 |
+ . /etc/env.d/50oracle-instantclient-basic |
76 |
+ export ORACLE_HOME |
77 |
+ export TNS_ADMIN |
78 |
+ else |
79 |
+ ewarn "Unable to set Oracle environment, Oracle plugin wont work" |
80 |
+ fi |
81 |
+ fi |
82 |
+ |
83 |
+ local test_command="${command} -t -C \"${COLLECTD_CONFIGFILE}\"" |
84 |
+ |
85 |
+ eval ${test_command} 1>/dev/null 2>&1 |
86 |
+ ret=$? |
87 |
+ if [ $ret -ne 0 ]; then |
88 |
+ eerror "${SVCNAME} has detected an error in your configuration:" |
89 |
+ eval ${test_command} |
90 |
+ fi |
91 |
+ |
92 |
+ return $ret |
93 |
+} |
94 |
+ |
95 |
+configtest() { |
96 |
+ ebegin "Checking ${SVCNAME} configuration" |
97 |
+ _checkconfig |
98 |
+ eend $? |
99 |
+} |
100 |
+ |
101 |
+start_pre() { |
102 |
+ if [ "${RC_CMD}" != "restart" ]; then |
103 |
+ configtest || return 1 |
104 |
+ fi |
105 |
+} |
106 |
+ |
107 |
+stop_pre() { |
108 |
+ if [ "${RC_CMD}" = "restart" ]; then |
109 |
+ configtest || return 1 |
110 |
+ fi |
111 |
+} |