commit:     9534f7c3279f6b8808c3e002e5f205217e66f535
Author:     Belhassen Dahmen <belhassen.dahmen <AT> adjust <DOT> com>
AuthorDate: Tue Apr 20 15:40:34 2021 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Wed Nov 17 08:08:29 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9534f7c3

net-analyzer/zabbix add reload() to zabbix-server init script

As zabbix-server process supports configuration reload in runtime, it
would be great to support with through the openrc commandline utility.

Bug: https://bugs.gentoo.org/824138
Signed-off-by: Belhassen Dahmen <zegeek94 <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/20473
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 net-analyzer/zabbix/files/zabbix-server-r1.init    | 25 ++++++++++++++++++++++
 ...{zabbix-5.4.7.ebuild => zabbix-5.4.7-r1.ebuild} |  2 +-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/net-analyzer/zabbix/files/zabbix-server-r1.init 
b/net-analyzer/zabbix/files/zabbix-server-r1.init
new file mode 100644
index 000000000000..1652ba782fa8
--- /dev/null
+++ b/net-analyzer/zabbix/files/zabbix-server-r1.init
@@ -0,0 +1,25 @@
+#!/sbin/openrc-run
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/sbin/zabbix_server"
+command_args="--foreground --config /etc/zabbix/zabbix_server.conf"
+command_background="true"
+command_user="zabbix:zabbix"
+pidfile="/run/${RC_SVCNAME}.pid"
+
+depend() {
+    need net
+    use mysql postgresql
+}
+
+start_pre() {
+       checkpath -q -d -m 0750 -o root:zabbix /etc/zabbix
+       checkpath -q -f -m 0640 -o root:zabbix /etc/zabbix/*.conf
+}
+
+reload() {
+       /usr/sbin/zabbix_server \
+               -c /etc/zabbix/zabbix_server.conf \
+               -R config_cache_reload
+}

diff --git a/net-analyzer/zabbix/zabbix-5.4.7.ebuild 
b/net-analyzer/zabbix/zabbix-5.4.7-r1.ebuild
similarity index 99%
rename from net-analyzer/zabbix/zabbix-5.4.7.ebuild
rename to net-analyzer/zabbix/zabbix-5.4.7-r1.ebuild
index f1795467d2f7..014d630c3a5c 100644
--- a/net-analyzer/zabbix/zabbix-5.4.7.ebuild
+++ b/net-analyzer/zabbix/zabbix-5.4.7-r1.ebuild
@@ -432,7 +432,7 @@ src_install() {
                fperms 0640 /etc/zabbix/zabbix_server.conf
                fowners root:zabbix /etc/zabbix/zabbix_server.conf
 
-               newinitd "${FILESDIR}"/zabbix-server.init zabbix-server
+               newinitd "${FILESDIR}"/zabbix-server-r1.init zabbix-server
 
                dosbin src/zabbix_server/zabbix_server
 

Reply via email to