Date: Sun, 24 Apr 2016 11:59:37 +0000 (UTC) From: Lars Engels <lme@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r413936 - in branches/2016Q2/net-mgmt: zabbix2-server zabbix2-server/files zabbix22-server zabbix22-server/files zabbix24-server zabbix24-server/files zabbix3-server zabbix3-server/files Message-ID: <201604241159.u3OBxbqx090932@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: lme Date: Sun Apr 24 11:59:37 2016 New Revision: 413936 URL: https://svnweb.freebsd.org/changeset/ports/413936 Log: MFH: r413935 - Fixes in {agent,proxy,server} rc start scripts: - SysV IPC leak - Restart race - Allow to specify a custom PATH in rc.conf - Bump PORTREVISION PR: 207896 Submitted by: kbowling Approved by: maintainer Sponsored by: Essen Linuxhotel Hackathon 2016 Approved by: portmgr (bapt) Modified: branches/2016Q2/net-mgmt/zabbix2-server/Makefile branches/2016Q2/net-mgmt/zabbix2-server/files/zabbix_agentd.in branches/2016Q2/net-mgmt/zabbix2-server/files/zabbix_proxy.in branches/2016Q2/net-mgmt/zabbix2-server/files/zabbix_server.in branches/2016Q2/net-mgmt/zabbix22-server/Makefile branches/2016Q2/net-mgmt/zabbix22-server/files/zabbix_agentd.in branches/2016Q2/net-mgmt/zabbix22-server/files/zabbix_proxy.in branches/2016Q2/net-mgmt/zabbix22-server/files/zabbix_server.in branches/2016Q2/net-mgmt/zabbix24-server/Makefile branches/2016Q2/net-mgmt/zabbix24-server/files/zabbix_agentd.in branches/2016Q2/net-mgmt/zabbix24-server/files/zabbix_proxy.in branches/2016Q2/net-mgmt/zabbix24-server/files/zabbix_server.in branches/2016Q2/net-mgmt/zabbix3-server/Makefile branches/2016Q2/net-mgmt/zabbix3-server/files/zabbix_agentd.in branches/2016Q2/net-mgmt/zabbix3-server/files/zabbix_proxy.in branches/2016Q2/net-mgmt/zabbix3-server/files/zabbix_server.in Directory Properties: branches/2016Q2/ (props changed) Modified: branches/2016Q2/net-mgmt/zabbix2-server/Makefile ============================================================================== --- branches/2016Q2/net-mgmt/zabbix2-server/Makefile Sun Apr 24 11:48:26 2016 (r413935) +++ branches/2016Q2/net-mgmt/zabbix2-server/Makefile Sun Apr 24 11:59:37 2016 (r413936) @@ -3,7 +3,7 @@ PORTNAME= zabbix2 PORTVERSION= 2.0.16 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= net-mgmt MASTER_SITES= SF/zabbix/ZABBIX%20Latest%20Stable/${PORTVERSION} PKGNAMESUFFIX?= -server Modified: branches/2016Q2/net-mgmt/zabbix2-server/files/zabbix_agentd.in ============================================================================== --- branches/2016Q2/net-mgmt/zabbix2-server/files/zabbix_agentd.in Sun Apr 24 11:48:26 2016 (r413935) +++ branches/2016Q2/net-mgmt/zabbix2-server/files/zabbix_agentd.in Sun Apr 24 11:59:37 2016 (r413936) @@ -9,6 +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. # . /etc/rc.subr @@ -16,11 +20,33 @@ name="zabbix_agentd" rcvar=zabbix_agentd_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - 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"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_agentd_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_agentd_paths}" run_rc_command "$1" Modified: branches/2016Q2/net-mgmt/zabbix2-server/files/zabbix_proxy.in ============================================================================== --- branches/2016Q2/net-mgmt/zabbix2-server/files/zabbix_proxy.in Sun Apr 24 11:48:26 2016 (r413935) +++ branches/2016Q2/net-mgmt/zabbix2-server/files/zabbix_proxy.in Sun Apr 24 11:59:37 2016 (r413936) @@ -9,6 +9,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. # . /etc/rc.subr @@ -16,11 +20,34 @@ name="zabbix_proxy" rcvar=zabbix_proxy_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - 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"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_proxy_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_proxy_paths}" run_rc_command "$1" Modified: branches/2016Q2/net-mgmt/zabbix2-server/files/zabbix_server.in ============================================================================== --- branches/2016Q2/net-mgmt/zabbix2-server/files/zabbix_server.in Sun Apr 24 11:48:26 2016 (r413935) +++ branches/2016Q2/net-mgmt/zabbix2-server/files/zabbix_server.in Sun Apr 24 11:59:37 2016 (r413936) @@ -9,6 +9,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. # . /etc/rc.subr @@ -16,11 +20,33 @@ name="zabbix_server" rcvar=zabbix_server_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - 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"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_server_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_server_paths}" run_rc_command "$1" Modified: branches/2016Q2/net-mgmt/zabbix22-server/Makefile ============================================================================== --- branches/2016Q2/net-mgmt/zabbix22-server/Makefile Sun Apr 24 11:48:26 2016 (r413935) +++ branches/2016Q2/net-mgmt/zabbix22-server/Makefile Sun Apr 24 11:59:37 2016 (r413936) @@ -3,6 +3,7 @@ PORTNAME= zabbix22 PORTVERSION= 2.2.11 +PORTREVISION= 1 CATEGORIES= net-mgmt MASTER_SITES= SF/zabbix/ZABBIX%20Latest%20Stable/${PORTVERSION} PKGNAMESUFFIX?= -server Modified: branches/2016Q2/net-mgmt/zabbix22-server/files/zabbix_agentd.in ============================================================================== --- branches/2016Q2/net-mgmt/zabbix22-server/files/zabbix_agentd.in Sun Apr 24 11:48:26 2016 (r413935) +++ branches/2016Q2/net-mgmt/zabbix22-server/files/zabbix_agentd.in Sun Apr 24 11:59:37 2016 (r413936) @@ -9,6 +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. # . /etc/rc.subr @@ -16,11 +20,33 @@ name="zabbix_agentd" rcvar=zabbix_agentd_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - 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"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_agentd_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_agentd_paths}" run_rc_command "$1" Modified: branches/2016Q2/net-mgmt/zabbix22-server/files/zabbix_proxy.in ============================================================================== --- branches/2016Q2/net-mgmt/zabbix22-server/files/zabbix_proxy.in Sun Apr 24 11:48:26 2016 (r413935) +++ branches/2016Q2/net-mgmt/zabbix22-server/files/zabbix_proxy.in Sun Apr 24 11:59:37 2016 (r413936) @@ -11,6 +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. # . /etc/rc.subr @@ -18,11 +22,33 @@ name="zabbix_proxy" rcvar=zabbix_proxy_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - 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"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_proxy_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_proxy_paths}" run_rc_command "$1" Modified: branches/2016Q2/net-mgmt/zabbix22-server/files/zabbix_server.in ============================================================================== --- branches/2016Q2/net-mgmt/zabbix22-server/files/zabbix_server.in Sun Apr 24 11:48:26 2016 (r413935) +++ branches/2016Q2/net-mgmt/zabbix22-server/files/zabbix_server.in Sun Apr 24 11:59:37 2016 (r413936) @@ -11,6 +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. # . /etc/rc.subr @@ -18,11 +22,33 @@ name="zabbix_server" rcvar=zabbix_server_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - 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"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_server_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_server_paths}" run_rc_command "$1" Modified: branches/2016Q2/net-mgmt/zabbix24-server/Makefile ============================================================================== --- branches/2016Q2/net-mgmt/zabbix24-server/Makefile Sun Apr 24 11:48:26 2016 (r413935) +++ branches/2016Q2/net-mgmt/zabbix24-server/Makefile Sun Apr 24 11:59:37 2016 (r413936) @@ -3,7 +3,7 @@ PORTNAME= zabbix24 PORTVERSION= 2.4.7 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= net-mgmt MASTER_SITES= SF/zabbix/ZABBIX%20Latest%20Stable/${PORTVERSION} PKGNAMESUFFIX?= -server Modified: branches/2016Q2/net-mgmt/zabbix24-server/files/zabbix_agentd.in ============================================================================== --- branches/2016Q2/net-mgmt/zabbix24-server/files/zabbix_agentd.in Sun Apr 24 11:48:26 2016 (r413935) +++ branches/2016Q2/net-mgmt/zabbix24-server/files/zabbix_agentd.in Sun Apr 24 11:59:37 2016 (r413936) @@ -9,6 +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. # . /etc/rc.subr @@ -16,11 +20,33 @@ name="zabbix_agentd" rcvar=zabbix_agentd_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - 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"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_agentd_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_agentd_paths}" run_rc_command "$1" Modified: branches/2016Q2/net-mgmt/zabbix24-server/files/zabbix_proxy.in ============================================================================== --- branches/2016Q2/net-mgmt/zabbix24-server/files/zabbix_proxy.in Sun Apr 24 11:48:26 2016 (r413935) +++ branches/2016Q2/net-mgmt/zabbix24-server/files/zabbix_proxy.in Sun Apr 24 11:59:37 2016 (r413936) @@ -11,6 +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. # . /etc/rc.subr @@ -18,11 +22,33 @@ name="zabbix_proxy" rcvar=zabbix_proxy_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - 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"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_proxy_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_proxy_paths}" run_rc_command "$1" Modified: branches/2016Q2/net-mgmt/zabbix24-server/files/zabbix_server.in ============================================================================== --- branches/2016Q2/net-mgmt/zabbix24-server/files/zabbix_server.in Sun Apr 24 11:48:26 2016 (r413935) +++ branches/2016Q2/net-mgmt/zabbix24-server/files/zabbix_server.in Sun Apr 24 11:59:37 2016 (r413936) @@ -11,6 +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. # . /etc/rc.subr @@ -18,11 +22,33 @@ name="zabbix_server" rcvar=zabbix_server_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - 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"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_server_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_server_paths}" run_rc_command "$1" Modified: branches/2016Q2/net-mgmt/zabbix3-server/Makefile ============================================================================== --- branches/2016Q2/net-mgmt/zabbix3-server/Makefile Sun Apr 24 11:48:26 2016 (r413935) +++ branches/2016Q2/net-mgmt/zabbix3-server/Makefile Sun Apr 24 11:59:37 2016 (r413936) @@ -3,7 +3,7 @@ PORTNAME= zabbix3 PORTVERSION= 3.0.1 -PORTREVISION?= 0 +PORTREVISION?= 2 CATEGORIES= net-mgmt MASTER_SITES= SF/zabbix/ZABBIX%20Latest%20Stable/${PORTVERSION} PKGNAMESUFFIX?= -server Modified: branches/2016Q2/net-mgmt/zabbix3-server/files/zabbix_agentd.in ============================================================================== --- branches/2016Q2/net-mgmt/zabbix3-server/files/zabbix_agentd.in Sun Apr 24 11:48:26 2016 (r413935) +++ branches/2016Q2/net-mgmt/zabbix3-server/files/zabbix_agentd.in Sun Apr 24 11:59:37 2016 (r413936) @@ -9,6 +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. # . /etc/rc.subr @@ -22,5 +26,30 @@ required_files="%%ETCDIR%%/${name}.conf" 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"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_agentd_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_agentd_paths}" run_rc_command "$1" Modified: branches/2016Q2/net-mgmt/zabbix3-server/files/zabbix_proxy.in ============================================================================== --- branches/2016Q2/net-mgmt/zabbix3-server/files/zabbix_proxy.in Sun Apr 24 11:48:26 2016 (r413935) +++ branches/2016Q2/net-mgmt/zabbix3-server/files/zabbix_proxy.in Sun Apr 24 11:59:37 2016 (r413936) @@ -11,6 +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. # . /etc/rc.subr @@ -18,11 +22,34 @@ name="zabbix_proxy" rcvar=zabbix_proxy_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - 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"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_proxy_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_proxy_paths}" run_rc_command "$1" Modified: branches/2016Q2/net-mgmt/zabbix3-server/files/zabbix_server.in ============================================================================== --- branches/2016Q2/net-mgmt/zabbix3-server/files/zabbix_server.in Sun Apr 24 11:48:26 2016 (r413935) +++ branches/2016Q2/net-mgmt/zabbix3-server/files/zabbix_server.in Sun Apr 24 11:59:37 2016 (r413936) @@ -11,6 +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. # . /etc/rc.subr @@ -18,11 +22,33 @@ name="zabbix_server" rcvar=zabbix_server_enable -command="%%PREFIX%%/sbin/${name}" -required_files="%%ETCDIR%%/${name}.conf" - 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"} + +command="%%PREFIX%%/sbin/${name}" +required_files="${zabbix_server_config}" +start_precmd="find_pidfile" +status_precmd="find_pidfile" +stop_precmd="find_pidfile" + +find_pidfile() +{ + if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then + pidfile="$_pidfile_from_conf" + else + pidfile="/tmp/${name}.pid" + fi + + # This shouldn't be necessary with pidfile, but empirically it was the + # only way to reap the parent PID instead of all PIDs from + # check_process, which may leak SysV IPC objects and prevent restart + # and/or race condition on restart. + rc_pid=$(check_pidfile ${pidfile} ${command}) +} + +export PATH="${zabbix_server_paths}" run_rc_command "$1"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604241159.u3OBxbqx090932>