FreeBSD Bugzilla – Attachment 170867 Details for
Bug 209891
net-mgmt/zabbix22 (server/agent/proxy) Update to 2.2.14 and Fix PID
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to fix PID issue
zabbix22-209154.patch (text/plain), 10.07 KB, created by
pg
on 2016-05-31 14:20:47 UTC
(
hide
)
Description:
patch to fix PID issue
Filename:
MIME Type:
Creator:
pg
Created:
2016-05-31 14:20:47 UTC
Size:
10.07 KB
patch
obsolete
>diff -uNr zabbix22-server.orig/Makefile zabbix22-server/Makefile >--- zabbix22-server.orig/Makefile 2016-05-13 16:13:32.867210000 +0300 >+++ zabbix22-server/Makefile 2016-05-18 11:17:13.549661668 +0300 >@@ -3,7 +3,7 @@ > > PORTNAME= zabbix22 > PORTVERSION= 2.2.12 >-PORTREVISION= 0 >+PORTREVISION= 1 > CATEGORIES= net-mgmt > MASTER_SITES= SF/zabbix/ZABBIX%20Latest%20Stable/${PORTVERSION} > PKGNAMESUFFIX?= -server >@@ -156,9 +156,19 @@ > ${WRKSRC}/src/zabbix_${ZABBIX_BUILD}/Makefile.in > @${FIND} ${WRKSRC} -type f \( -name '*.bak' -or -name '*.orig' \) -exec ${RM} -f {} + > >-post-install: >-.if ${PORT_OPTIONS:MJAVAGW} >- @${MV} ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh.sample >+.if ${ZABBIX_BUILD} == "server" >+ @${REINPLACE_CMD} -e 's#PidFile=/tmp/zabbix_server.pid#PidFile=/var/run/zabbix/zabbix_server.pid#g' \ >+ ${WRKSRC}/conf/zabbix_server*.conf >+.endif >+ >+.if ${ZABBIX_BUILD} == "proxy" >+ @${REINPLACE_CMD} -e 's#PidFile=/tmp/zabbix_proxy.pid#PidFile=/var/run/zabbix/zabbix_proxy.pid#g' \ >+ ${WRKSRC}/conf/zabbix_proxy*.conf >+.endif >+ >+.if ${ZABBIX_BUILD} == "agent" >+ @${REINPLACE_CMD} -e 's#PidFile=/tmp/zabbix_agentd.pid#PidFile=/var/run/zabbix/zabbix_agentd.pid#g' \ >+ ${WRKSRC}/conf/zabbix_agentd.conf > .endif > > .if ${ZABBIX_BUILD} != "agent" >@@ -168,4 +178,9 @@ > .endif > .endif > >+post-install: >+.if ${PORT_OPTIONS:MJAVAGW} >+ @${MV} ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh.sample >+.endif >+ > .include <bsd.port.mk> >diff -uNr zabbix22-server.orig/files/patch-src-zabbix_agent_zabbix_agentd.c zabbix22-server/files/patch-src-zabbix_agent_zabbix_agentd.c >--- zabbix22-server.orig/files/patch-src-zabbix_agent_zabbix_agentd.c 1970-01-01 03:00:00.000000000 +0300 >+++ zabbix22-server/files/patch-src-zabbix_agent_zabbix_agentd.c 2016-05-13 14:51:12.786550000 +0300 >@@ -0,0 +1,11 @@ >+--- src/zabbix_agent/zabbix_agentd.c.orig 2016-05-13 14:37:25.696606000 +0300 >++++ src/zabbix_agent/zabbix_agentd.c 2016-05-13 14:49:45.011554761 +0300 >+@@ -521,7 +521,7 @@ >+ CONFIG_LOAD_MODULE_PATH = zbx_strdup(CONFIG_LOAD_MODULE_PATH, LIBDIR "/modules"); >+ >+ if (NULL == CONFIG_PID_FILE) >+- CONFIG_PID_FILE = "/tmp/zabbix_agentd.pid"; >++ CONFIG_PID_FILE = "/var/run/zabbix/zabbix_agentd.pid"; >+ #endif >+ if (NULL == CONFIG_LOG_TYPE_STR) >+ CONFIG_LOG_TYPE_STR = zbx_strdup(CONFIG_LOG_TYPE_STR, ZBX_OPTION_LOGTYPE_FILE); >diff -uNr zabbix22-server.orig/files/patch-src-zabbix_proxy_proxy.c zabbix22-server/files/patch-src-zabbix_proxy_proxy.c >--- zabbix22-server.orig/files/patch-src-zabbix_proxy_proxy.c 1970-01-01 03:00:00.000000000 +0300 >+++ zabbix22-server/files/patch-src-zabbix_proxy_proxy.c 2016-05-13 14:47:29.182567000 +0300 >@@ -0,0 +1,11 @@ >+--- src/zabbix_proxy/proxy.c.orig 2016-04-20 12:51:20.000000000 +0300 >++++ src/zabbix_proxy/proxy.c 2016-05-13 14:46:44.193569184 +0300 >+@@ -389,7 +389,7 @@ >+ CONFIG_SNMPTRAP_FILE = zbx_strdup(CONFIG_SNMPTRAP_FILE, "/tmp/zabbix_traps.tmp"); >+ >+ if (NULL == CONFIG_PID_FILE) >+- CONFIG_PID_FILE = zbx_strdup(CONFIG_PID_FILE, "/tmp/zabbix_proxy.pid"); >++ CONFIG_PID_FILE = zbx_strdup(CONFIG_PID_FILE, "/var/run/zabbix/zabbix_proxy.pid"); >+ >+ if (NULL == CONFIG_TMPDIR) >+ CONFIG_TMPDIR = zbx_strdup(CONFIG_TMPDIR, "/tmp"); >diff -uNr zabbix22-server.orig/files/patch-src-zabbix_server_server.c zabbix22-server/files/patch-src-zabbix_server_server.c >--- zabbix22-server.orig/files/patch-src-zabbix_server_server.c 1970-01-01 03:00:00.000000000 +0300 >+++ zabbix22-server/files/patch-src-zabbix_server_server.c 2016-05-13 14:28:09.669645000 +0300 >@@ -0,0 +1,11 @@ >+--- src/zabbix_server/server.c.orig 2016-04-20 12:51:20.000000000 +0300 >++++ src/zabbix_server/server.c 2016-05-13 14:20:17.603677788 +0300 >+@@ -369,7 +369,7 @@ >+ CONFIG_SNMPTRAP_FILE = zbx_strdup(CONFIG_SNMPTRAP_FILE, "/tmp/zabbix_traps.tmp"); >+ >+ if (NULL == CONFIG_PID_FILE) >+- CONFIG_PID_FILE = zbx_strdup(CONFIG_PID_FILE, "/tmp/zabbix_server.pid"); >++ CONFIG_PID_FILE = zbx_strdup(CONFIG_PID_FILE, "/var/run/zabbix/zabbix_server.pid"); >+ >+ if (NULL == CONFIG_ALERT_SCRIPTS_PATH) >+ CONFIG_ALERT_SCRIPTS_PATH = zbx_strdup(CONFIG_ALERT_SCRIPTS_PATH, DATADIR "/zabbix/alertscripts"); >diff -uNr zabbix22-server.orig/files/zabbix_agentd.in zabbix22-server/files/zabbix_agentd.in >--- zabbix22-server.orig/files/zabbix_agentd.in 2016-05-13 16:13:32.894208000 +0300 >+++ zabbix22-server/files/zabbix_agentd.in 2016-05-13 15:05:56.061488000 +0300 >@@ -9,10 +9,10 @@ > # > # zabbix_agentd_enable (bool): Set to NO by default. Set it to YES to > # enable zabbix_agentd. >-# zabbix_agentd_paths (string): Set to standard path by default. Set a search >-# if you have custom userparams that need binaries elsewhere. > # zabbix_agentd_config (string): Set to the standard config file path by > # default. >+# zabbix_agentd_pidfile (string): Location of the asterisk pid file >+# Default is /var/run/zabbix/zabbix_agentd.pid > # > > . /etc/rc.subr >@@ -22,22 +22,27 @@ > > load_rc_config $name > >-: ${zabbix_agentd_enable="NO"} >-: ${zabbix_agentd_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin} >-: ${zabbix_agentd_config="%%ETCDIR%%/${name}.conf"} >+: ${zabbix_agentd_enable:=NO} >+: ${zabbix_agentd_config:=%%ETCDIR%%/${name}.conf} >+: ${zabbix_agentd_pidfile:=/var/run/zabbix/zabbix_agentd.pid} > > command="%%PREFIX%%/sbin/${name}" > required_files="${zabbix_agentd_config}" >-start_precmd="find_pidfile" >-status_precmd="find_pidfile" >-stop_precmd="find_pidfile" > >-find_pidfile() >+start_precmd=zabbix_agentd_precmd >+status_precmd=zabbix_agentd_precmd >+stop_precmd=zabbix_agentd_precmd >+ >+zabbix_agentd_precmd() > { > if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then > pidfile="$_pidfile_from_conf" > else >- pidfile="/tmp/${name}.pid" >+ pidfile=${zabbix_agentd_pidfile} >+ local rundir=${zabbix_agentd_pidfile%/*} >+ if [ ! -d $rundir ] ; then >+ install -d -m 0755 -o zabbix -g zabbix $rundir >+ fi > fi > > # This shouldn't be necessary with pidfile, but empirically it was the >@@ -47,6 +52,4 @@ > rc_pid=$(check_pidfile ${pidfile} ${command}) > } > >-export PATH="${zabbix_agentd_paths}" >- > run_rc_command "$1" >diff -uNr zabbix22-server.orig/files/zabbix_proxy.in zabbix22-server/files/zabbix_proxy.in >--- zabbix22-server.orig/files/zabbix_proxy.in 2016-05-13 16:13:32.882210000 +0300 >+++ zabbix22-server/files/zabbix_proxy.in 2016-05-13 14:44:17.197578000 +0300 >@@ -11,10 +11,10 @@ > # > # zabbix_proxy_enable (bool): Set to NO by default. Set it to YES to > # enable zabbix_proxy. >-# zabbix_proxy_paths (string): Set to standard path by default. Set a search >-# if you have custom externals that need binaries elsewhere. > # zabbix_proxy_config (string): Set to the standard config file path by > # default. >+# zabbix_proxy_pidfile (string): Location of the asterisk pid file >+# Default is /var/run/zabbix/zabbix_proxy.pid > # > > . /etc/rc.subr >@@ -24,22 +24,27 @@ > > load_rc_config $name > >-: ${zabbix_proxy_enable="NO"} >-: ${zabbix_proxy_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin} >-: ${zabbix_proxy_config="%%ETCDIR%%/${name}.conf"} >+: ${zabbix_proxy_enable:=NO} >+: ${zabbix_proxy_config:=%%ETCDIR%%/${name}.conf} >+: ${zabbix_proxy_pidfile:=/var/run/zabbix/zabbix_proxy.pid} > > command="%%PREFIX%%/sbin/${name}" > required_files="${zabbix_proxy_config}" >-start_precmd="find_pidfile" >-status_precmd="find_pidfile" >-stop_precmd="find_pidfile" > >-find_pidfile() >+start_precmd=zabbix_proxy_precmd >+status_precmd=zabbix_proxy_precmd >+stop_precmd=zabbix_proxy_precmd >+ >+zabbix_proxy_precmd() > { >- if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then >+ if get_pidfile_from_conf PidFile ${zabbix_proxy_config}; then > pidfile="$_pidfile_from_conf" > else >- pidfile="/tmp/${name}.pid" >+ pidfile=${zabbix_proxy_pidfile} >+ local rundir=${zabbix_proxy_pidfile%/*} >+ if [ ! -d $rundir ] ; then >+ install -d -m 0755 -o zabbix -g zabbix $rundir >+ fi > fi > > # This shouldn't be necessary with pidfile, but empirically it was the >@@ -49,6 +54,4 @@ > rc_pid=$(check_pidfile ${pidfile} ${command}) > } > >-export PATH="${zabbix_proxy_paths}" >- > run_rc_command "$1" >diff -uNr zabbix22-server.orig/files/zabbix_server.in zabbix22-server/files/zabbix_server.in >--- zabbix22-server.orig/files/zabbix_server.in 2016-05-13 16:13:32.900211000 +0300 >+++ zabbix22-server/files/zabbix_server.in 2016-05-13 14:26:40.145651000 +0300 >@@ -11,10 +11,10 @@ > # > # zabbix_server_enable (bool): Set to NO by default. Set it to YES to > # enable zabbix_server. >-# zabbix_server_paths (string): Set to standard path by default. Set a search >-# if you have custom externals that need binaries elsewhere. > # zabbix_server_config (string): Set to the standard config file path by > # default. >+# zabbix_server_pidfile (string): Location of the asterisk pid file >+# Default is /var/run/zabbix/zabbix_server.pid > # > > . /etc/rc.subr >@@ -24,22 +24,27 @@ > > load_rc_config $name > >-: ${zabbix_server_enable="NO"} >-: ${zabbix_server_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin} >-: ${zabbix_server_config="%%ETCDIR%%/${name}.conf"} >+: ${zabbix_server_enable:=NO} >+: ${zabbix_server_config:=%%ETCDIR%%/${name}.conf} >+: ${zabbix_server_pidfile:=/var/run/zabbix/zabbix_server.pid} > > command="%%PREFIX%%/sbin/${name}" > required_files="${zabbix_server_config}" >-start_precmd="find_pidfile" >-status_precmd="find_pidfile" >-stop_precmd="find_pidfile" > >-find_pidfile() >+start_precmd=zabbix_server_precmd >+status_precmd=zabbix_server_precmd >+stop_precmd=zabbix_server_precmd >+ >+zabbix_server_precmd() > { >- if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then >+ if get_pidfile_from_conf PidFile ${zabbix_server_config}; then > pidfile="$_pidfile_from_conf" > else >- pidfile="/tmp/${name}.pid" >+ pidfile=${zabbix_server_pidfile} >+ local rundir=${zabbix_server_pidfile%/*} >+ if [ ! -d $rundir ] ; then >+ install -d -m 0755 -o zabbix -g zabbix $rundir >+ fi > fi > > # This shouldn't be necessary with pidfile, but empirically it was the >@@ -49,6 +54,4 @@ > rc_pid=$(check_pidfile ${pidfile} ${command}) > } > >-export PATH="${zabbix_server_paths}" >- > run_rc_command "$1"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
pg:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 209891
:
170867
|
171539
|
173227
|
173339
|
173343