summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Kostecki <conikost@gentoo.org>2022-04-05 21:18:08 +0200
committerConrad Kostecki <conikost@gentoo.org>2022-06-05 16:06:07 +0200
commitc1983aebe66b95bd9da87d40db1f608ba90c7528 (patch)
tree04fae61d5ee07900aac246fee2bd3ee8971d41af /app-metrics
parentapp-arch/rar: take ownership (diff)
downloadgentoo-c1983aebe66b95bd9da87d40db1f608ba90c7528.tar.gz
gentoo-c1983aebe66b95bd9da87d40db1f608ba90c7528.tar.bz2
gentoo-c1983aebe66b95bd9da87d40db1f608ba90c7528.zip
app-metrics/collectd: fix missing group in init script
Signed-off-by: Conrad Kostecki <conikost@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/24922 Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
Diffstat (limited to 'app-metrics')
-rw-r--r--app-metrics/collectd/collectd-5.12.0-r7.ebuild (renamed from app-metrics/collectd/collectd-5.12.0-r6.ebuild)2
-rw-r--r--app-metrics/collectd/files/collectd.initd-r371
2 files changed, 72 insertions, 1 deletions
diff --git a/app-metrics/collectd/collectd-5.12.0-r6.ebuild b/app-metrics/collectd/collectd-5.12.0-r7.ebuild
index 608f269fb2c6..1e9d0b18e23e 100644
--- a/app-metrics/collectd/collectd-5.12.0-r6.ebuild
+++ b/app-metrics/collectd/collectd-5.12.0-r7.ebuild
@@ -464,7 +464,7 @@ src_install() {
keepdir /var/lib/${PN}
fowners collectd:collectd /var/lib/${PN}
- newinitd "${FILESDIR}/${PN}.initd-r2" ${PN}
+ newinitd "${FILESDIR}/${PN}.initd-r3" ${PN}
newconfd "${FILESDIR}/${PN}.confd-r2" ${PN}
systemd_newunit "contrib/systemd.${PN}.service" ${PN}.service
diff --git a/app-metrics/collectd/files/collectd.initd-r3 b/app-metrics/collectd/files/collectd.initd-r3
new file mode 100644
index 000000000000..aa3396d5a451
--- /dev/null
+++ b/app-metrics/collectd/files/collectd.initd-r3
@@ -0,0 +1,71 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+COLLECTD_CONFIGFILE=${COLLECTD_CONFIGFILE:-"/etc/collectd.conf"}
+COLLECTD_PIDFILE=${COLLECTD_PIDFILE:-"/run/collectd.pid"}
+COLLECTD_NICELEVEL=${COLLECTD_NICELEVEL:-5}
+COLLECTD_USER=${COLLECTD_USER:-"collectd"}
+COLLECTD_GROUP=${COLLECTD_GROUP:-"collectd"}
+COLLECTD_SSDARGS=${COLLECTD_SSDARGS:-"--wait 1000"}
+COLLECTD_TERMTIMEOUT=${COLLECTD_TERMTIMEOUT:-"TERM/25/KILL/5"}
+COLLECTD_OPTS=${COLLECTD_OPTS:-""}
+
+command="/usr/sbin/collectd"
+command_args="${COLLECTD_OPTS} -C \"${COLLECTD_CONFIGFILE}\" -f"
+command_background=true
+command_group="${COLLECTD_GROUP}"
+command_user="${COLLECTD_USER}"
+start_stop_daemon_args="${COLLECTD_SSDARGS} --nice ${COLLECTD_NICELEVEL}"
+pidfile="${COLLECTD_PIDFILE}"
+retry="${COLLECTD_TERMTIMEOUT}"
+
+extra_commands="configtest"
+description_configtest="Run collectd's internal config check."
+
+required_files="\"${COLLECTD_CONFIGFILE}\""
+
+depend() {
+ use dns
+}
+
+_checkconfig() {
+ if [ $(sed '/^$\|^#/d' "${COLLECTD_CONFIGFILE}" | grep 'LoadPlugin[[:space:]]\+oracle' | wc -l) -ge 1 ] ; then
+ if [ -e /etc/env.d/50oracle-instantclient-basic ] ; then
+ . /etc/env.d/50oracle-instantclient-basic
+ export ORACLE_HOME
+ export TNS_ADMIN
+ else
+ ewarn "Unable to set Oracle environment, Oracle plugin wont work"
+ fi
+ fi
+
+ local test_command="${command} -t -C \"${COLLECTD_CONFIGFILE}\""
+
+ eval ${test_command} 1>/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} has detected an error in your configuration:"
+ eval ${test_command}
+ fi
+
+ return $ret
+}
+
+configtest() {
+ ebegin "Checking ${SVCNAME} configuration"
+ _checkconfig
+ eend $?
+}
+
+start_pre() {
+ if [ "${RC_CMD}" != "restart" ]; then
+ configtest || return 1
+ fi
+}
+
+stop_pre() {
+ if [ "${RC_CMD}" = "restart" ]; then
+ configtest || return 1
+ fi
+}