Skip to content

Commit

Permalink
net-analyzer/zabbix add reload() to zabbix-server init script
Browse files Browse the repository at this point in the history
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 <[email protected]>
Closes: gentoo#20473
Signed-off-by: Florian Schmaus <[email protected]>
  • Loading branch information
zegeek authored and Flowdalic committed Nov 17, 2021
1 parent d760096 commit 9534f7c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions net-analyzer/zabbix/files/zabbix-server-r1.init
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9534f7c

Please sign in to comment.