Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Sep 2021 09:59:52 GMT
From:      Juraj Lutter <otis@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 992c97efcfeb - main - net-mgmt/zabbix54: Improve pid and log file handling
Message-ID:  <202109060959.1869xqnX085542@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by otis:

URL: https://cgit.FreeBSD.org/ports/commit/?id=992c97efcfebe3849d2c5d352beb34d5ef06ad76

commit 992c97efcfebe3849d2c5d352beb34d5ef06ad76
Author:     Juraj Lutter <otis@FreeBSD.org>
AuthorDate: 2021-09-06 09:21:58 +0000
Commit:     Juraj Lutter <otis@FreeBSD.org>
CommitDate: 2021-09-06 09:59:38 +0000

    net-mgmt/zabbix54: Improve pid and log file handling
    
    - Provide correct sample config files
    - Put pid file under /var/run/zabbix and default log
      file into /var/log/zabbix directory. Create the directories
      as needed.
    - Bump PKGREVISION for agent, proxy and server components only.
    
    PR:             258076
---
 net-mgmt/zabbix54-frontend/Makefile             |  1 +
 net-mgmt/zabbix54-java/Makefile                 |  1 +
 net-mgmt/zabbix54-server/Makefile               |  2 +-
 net-mgmt/zabbix54-server/files/pkg-message.in   |  3 +++
 net-mgmt/zabbix54-server/files/zabbix_agentd.in | 15 +++++++++------
 net-mgmt/zabbix54-server/files/zabbix_proxy.in  | 15 +++++++++------
 net-mgmt/zabbix54-server/files/zabbix_server.in | 15 +++++++++------
 net-mgmt/zabbix54-server/pkg-plist              |  2 +-
 net-mgmt/zabbix54-server/pkg-plist.agent        |  2 +-
 9 files changed, 35 insertions(+), 21 deletions(-)

diff --git a/net-mgmt/zabbix54-frontend/Makefile b/net-mgmt/zabbix54-frontend/Makefile
index ba98309a8be9..b70eaac36074 100644
--- a/net-mgmt/zabbix54-frontend/Makefile
+++ b/net-mgmt/zabbix54-frontend/Makefile
@@ -1,4 +1,5 @@
 PORTNAME=	zabbix54
+PORTREVISION=	0
 CATEGORIES=	net-mgmt
 PKGNAMESUFFIX=	-frontend
 
diff --git a/net-mgmt/zabbix54-java/Makefile b/net-mgmt/zabbix54-java/Makefile
index 9f077c9859a1..b7f294d9699c 100644
--- a/net-mgmt/zabbix54-java/Makefile
+++ b/net-mgmt/zabbix54-java/Makefile
@@ -1,4 +1,5 @@
 PORTNAME=	zabbix54
+PORTREVISION=	0
 CATEGORIES=	net-mgmt
 PKGNAMESUFFIX=	-java
 
diff --git a/net-mgmt/zabbix54-server/Makefile b/net-mgmt/zabbix54-server/Makefile
index bab817156eea..1e6ba8d2f213 100644
--- a/net-mgmt/zabbix54-server/Makefile
+++ b/net-mgmt/zabbix54-server/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	zabbix54
 DISTVERSION=	5.4.4
-PORTREVISION?=	0
+PORTREVISION?=	1
 CATEGORIES=	net-mgmt
 MASTER_SITES=	https://cdn.zabbix.com/zabbix/sources/stable/${DISTVERSION:R}/
 PKGNAMESUFFIX?=	-server
diff --git a/net-mgmt/zabbix54-server/files/pkg-message.in b/net-mgmt/zabbix54-server/files/pkg-message.in
index ec27563cb050..8ce528447ee0 100644
--- a/net-mgmt/zabbix54-server/files/pkg-message.in
+++ b/net-mgmt/zabbix54-server/files/pkg-message.in
@@ -1,6 +1,9 @@
 [
 { type: install
   message: <<EOM
+Log files are now under /var/log/zabbix directory instead of /tmp as it was
+previously.
+
 For Zabbix server and proxy daemons, as well as Zabbix frontend, a database is
 required. It is not needed to run Zabbix agent.
 
diff --git a/net-mgmt/zabbix54-server/files/zabbix_agentd.in b/net-mgmt/zabbix54-server/files/zabbix_agentd.in
index d3ac5102f812..5fa104126dbe 100644
--- a/net-mgmt/zabbix54-server/files/zabbix_agentd.in
+++ b/net-mgmt/zabbix54-server/files/zabbix_agentd.in
@@ -39,15 +39,18 @@ stop_precmd=zabbix_agentd_precmd
 
 zabbix_agentd_precmd()
 {
+	pidfile=${zabbix_agentd_pidfile}
 	if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then
 		pidfile="$_pidfile_from_conf"
-	else
-		pidfile=${zabbix_agentd_pidfile}
-		local rundir=${zabbix_agentd_pidfile%/*}
-		if [ ! -d $rundir ] ; then
-			install -d -m 0755 -o zabbix -g zabbix $rundir
-		fi
 	fi
+	logfile=/var/log/zabbix/zabbix_agentd.log
+	if get_pidfile_from_conf LogFile ${zabbix_agentd_config}; then
+		logfile="$_pidfile_from_conf"
+	fi
+	local rundir=${pidfile%/*}
+	local logdir=${logfile%/*}
+	[ -d $rundir ] || install -d -m 0755 -o zabbix -g zabbix $rundir
+	[ -d $logdir ] || install -d -m 0755 -o zabbix -g zabbix $logdir
 
 	# This shouldn't be necessary with pidfile, but empirically it was the
 	# only way to reap the parent PID instead of all PIDs from
diff --git a/net-mgmt/zabbix54-server/files/zabbix_proxy.in b/net-mgmt/zabbix54-server/files/zabbix_proxy.in
index 213c989966f8..274c75c29251 100644
--- a/net-mgmt/zabbix54-server/files/zabbix_proxy.in
+++ b/net-mgmt/zabbix54-server/files/zabbix_proxy.in
@@ -40,15 +40,18 @@ stop_precmd=zabbix_proxy_precmd
 
 zabbix_proxy_precmd()
 {
+	pidfile=${zabbix_proxy_pidfile}
 	if get_pidfile_from_conf PidFile ${zabbix_proxy_config}; then
 		pidfile="$_pidfile_from_conf"
-	else
-		pidfile=${zabbix_proxy_pidfile}
-		local rundir=${zabbix_proxy_pidfile%/*}
-		if [ ! -d $rundir ] ; then
-			install -d -m 0755 -o zabbix -g zabbix $rundir
-		fi
 	fi
+	logfile=/var/log/zabbix/zabbix_proxy.log
+	if get_pidfile_from_conf LogFile ${zabbix_proxy_config}; then
+		logfile="$_pidfile_from_conf"
+	fi
+	local rundir=${pidfile%/*}
+	local logdir=${logfile%/*}
+	[ -d $rundir ] || install -d -m 0755 -o zabbix -g zabbix $rundir
+	[ -d $logdir ] || install -d -m 0755 -o zabbix -g zabbix $logdir
 
 	# This shouldn't be necessary with pidfile, but empirically it was the
 	# only way to reap the parent PID instead of all PIDs from
diff --git a/net-mgmt/zabbix54-server/files/zabbix_server.in b/net-mgmt/zabbix54-server/files/zabbix_server.in
index 4ccf2b80aa85..68e9f052734e 100644
--- a/net-mgmt/zabbix54-server/files/zabbix_server.in
+++ b/net-mgmt/zabbix54-server/files/zabbix_server.in
@@ -41,15 +41,18 @@ stop_precmd=zabbix_server_precmd
 
 zabbix_server_precmd()
 {
+	pidfile=${zabbix_server_pidfile}
 	if get_pidfile_from_conf PidFile ${zabbix_server_config}; then
 		pidfile="$_pidfile_from_conf"
-	else
-		pidfile=${zabbix_server_pidfile}
-		local rundir=${zabbix_server_pidfile%/*}
-		if [ ! -d $rundir ] ; then
-			install -d -m 0755 -o zabbix -g zabbix $rundir
-		fi
 	fi
+	logfile=/var/log/zabbix/zabbix_server.log
+	if get_pidfile_from_conf LogFile ${zabbix_server_config}; then
+		logfile="$_pidfile_from_conf"
+	fi
+	local rundir=${pidfile%/*}
+	local logdir=${logfile%/*}
+	[ -d $rundir ] || install -d -m 0755 -o zabbix -g zabbix $rundir
+	[ -d $logdir ] || install -d -m 0755 -o zabbix -g zabbix $logdir
 
 	# This shouldn't be necessary with pidfile, but empirically it was the
 	# only way to reap the parent PID instead of all PIDs from
diff --git a/net-mgmt/zabbix54-server/pkg-plist b/net-mgmt/zabbix54-server/pkg-plist
index 46f736123b7c..0074bf89f43a 100644
--- a/net-mgmt/zabbix54-server/pkg-plist
+++ b/net-mgmt/zabbix54-server/pkg-plist
@@ -14,7 +14,7 @@
 %%DATADIR%%/%%ZABBIX_BUILD%%/database/sqlite3/data.sql
 %%DATADIR%%/%%ZABBIX_BUILD%%/database/sqlite3/images.sql
 %%DATADIR%%/%%ZABBIX_BUILD%%/database/sqlite3/schema.sql
-%%ETCDIR%%/zabbix_%%ZABBIX_BUILD%%.conf.sample
+@sample %%ETCDIR%%/zabbix_%%ZABBIX_BUILD%%.conf.sample
 %%PROXY%%@dir %%ETCDIR%%/zabbix_proxy.conf.d
 %%SERVER%%@dir %%ETCDIR%%/zabbix_server.conf.d
 %%SERVER%%@dir %%ETCDIR%%/zabbix/alertscripts
diff --git a/net-mgmt/zabbix54-server/pkg-plist.agent b/net-mgmt/zabbix54-server/pkg-plist.agent
index ca02f1d8b4eb..e2e36a7e7499 100644
--- a/net-mgmt/zabbix54-server/pkg-plist.agent
+++ b/net-mgmt/zabbix54-server/pkg-plist.agent
@@ -1,4 +1,4 @@
-%%ETCDIR%%/zabbix_agentd.conf.sample
+@sample %%ETCDIR%%/zabbix_agentd.conf.sample
 bin/zabbix_get
 bin/zabbix_sender
 man/man1/zabbix_get.1.gz



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109060959.1869xqnX085542>