From: Daniel F. Dickinson Date: Thu, 25 Dec 2025 20:04:47 +0000 (-0500) Subject: zabbix: fix agentd PidFile creation X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=1ff6a92251c789211df3c2940967688bf23f69ad;p=feed%2Fpackages.git zabbix: fix agentd PidFile creation Addresses the issue pointed out in #28165, which is that zabbix_agentd always creates a PidFile and has no option to disable PidFile creation. Therefore update the configuration file to default to create a PidFile where we want it. Close #28165 Signed-off-by: Daniel F. Dickinson --- diff --git a/admin/zabbix/files/zabbix_agentd.init b/admin/zabbix/files/zabbix_agentd.init index ea886346e7..2938caff4d 100755 --- a/admin/zabbix/files/zabbix_agentd.init +++ b/admin/zabbix/files/zabbix_agentd.init @@ -13,6 +13,9 @@ start_service() { [ -f ${CONFIG} ] || return 1 + mkdir -p /var/run/zabbix + chown zabbix:zabbix /var/run/zabbix + procd_open_instance procd_set_param command ${PROG} -c ${CONFIG} -f procd_set_param respawn diff --git a/admin/zabbix/patches/010-change-agentd-config.patch b/admin/zabbix/patches/010-change-agentd-config.patch index 2dbae8baa5..024b56e879 100644 --- a/admin/zabbix/patches/010-change-agentd-config.patch +++ b/admin/zabbix/patches/010-change-agentd-config.patch @@ -4,13 +4,13 @@ Date: Wed, 17 Dec 2025 18:28:37 -0500 Subject: [PATCH] zabbix_agentd: Tweak config file for OpenWrt Note: original patch had no header, header added 2025-12-16, while -bumping package version. +bumping package version. Modified 2025-12-25. 1. Use syslog not a file for logging -2. Do not use PidFile -3. Only start in passive agent by default +2. Place PidFile under /var/run/zabbix +3. Only start passive agent by default 4. Do not do active checks by default -5. Use the system hostname as hostname. +5. Use the system hostname as hostname (except on zabbix server) 6. Include configurations under /etc/zabbix_agentd.conf.d/ Signed-off-by: Daniel F. Dickinson @@ -30,8 +30,8 @@ Signed-off-by: Daniel F. Dickinson -# Mandatory: no -# Default: -# PidFile=/tmp/zabbix_agentd.pid -+# We do not need PidFile with procd -+# PidFile=/var/run/zabbix_agentd.pid ++# Zabbix always creates a PidFile. Make sure it is where we want it. ++PidFile=/var/run/zabbix/zabbix_agentd.pid + +# use syslog +LogType=system