svn commit: r413935 - in head/net-mgmt: zabbix2-server zabbix2-server/files zabbix22-server zabbix22-server/files zabbix24-server zabbix24-server/files zabbix3-server zabbix3-server/files
Lars Engels
lme at FreeBSD.org
Sun Apr 24 11:48:29 UTC 2016
Author: lme
Date: Sun Apr 24 11:48:26 2016
New Revision: 413935
URL: https://svnweb.freebsd.org/changeset/ports/413935
Log:
- 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
MFH: 2016Q2
Sponsored by: Essen Linuxhotel Hackathon 2016
Modified:
head/net-mgmt/zabbix2-server/Makefile
head/net-mgmt/zabbix2-server/files/zabbix_agentd.in
head/net-mgmt/zabbix2-server/files/zabbix_proxy.in
head/net-mgmt/zabbix2-server/files/zabbix_server.in
head/net-mgmt/zabbix22-server/Makefile
head/net-mgmt/zabbix22-server/files/zabbix_agentd.in
head/net-mgmt/zabbix22-server/files/zabbix_proxy.in
head/net-mgmt/zabbix22-server/files/zabbix_server.in
head/net-mgmt/zabbix24-server/Makefile
head/net-mgmt/zabbix24-server/files/zabbix_agentd.in
head/net-mgmt/zabbix24-server/files/zabbix_proxy.in
head/net-mgmt/zabbix24-server/files/zabbix_server.in
head/net-mgmt/zabbix3-server/Makefile
head/net-mgmt/zabbix3-server/files/zabbix_agentd.in
head/net-mgmt/zabbix3-server/files/zabbix_proxy.in
head/net-mgmt/zabbix3-server/files/zabbix_server.in
Modified: head/net-mgmt/zabbix2-server/Makefile
==============================================================================
--- head/net-mgmt/zabbix2-server/Makefile Sun Apr 24 10:22:47 2016 (r413934)
+++ head/net-mgmt/zabbix2-server/Makefile Sun Apr 24 11:48:26 2016 (r413935)
@@ -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: head/net-mgmt/zabbix2-server/files/zabbix_agentd.in
==============================================================================
--- head/net-mgmt/zabbix2-server/files/zabbix_agentd.in Sun Apr 24 10:22:47 2016 (r413934)
+++ head/net-mgmt/zabbix2-server/files/zabbix_agentd.in Sun Apr 24 11:48:26 2016 (r413935)
@@ -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: head/net-mgmt/zabbix2-server/files/zabbix_proxy.in
==============================================================================
--- head/net-mgmt/zabbix2-server/files/zabbix_proxy.in Sun Apr 24 10:22:47 2016 (r413934)
+++ head/net-mgmt/zabbix2-server/files/zabbix_proxy.in Sun Apr 24 11:48:26 2016 (r413935)
@@ -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: head/net-mgmt/zabbix2-server/files/zabbix_server.in
==============================================================================
--- head/net-mgmt/zabbix2-server/files/zabbix_server.in Sun Apr 24 10:22:47 2016 (r413934)
+++ head/net-mgmt/zabbix2-server/files/zabbix_server.in Sun Apr 24 11:48:26 2016 (r413935)
@@ -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: head/net-mgmt/zabbix22-server/Makefile
==============================================================================
--- head/net-mgmt/zabbix22-server/Makefile Sun Apr 24 10:22:47 2016 (r413934)
+++ head/net-mgmt/zabbix22-server/Makefile Sun Apr 24 11:48:26 2016 (r413935)
@@ -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: head/net-mgmt/zabbix22-server/files/zabbix_agentd.in
==============================================================================
--- head/net-mgmt/zabbix22-server/files/zabbix_agentd.in Sun Apr 24 10:22:47 2016 (r413934)
+++ head/net-mgmt/zabbix22-server/files/zabbix_agentd.in Sun Apr 24 11:48:26 2016 (r413935)
@@ -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: head/net-mgmt/zabbix22-server/files/zabbix_proxy.in
==============================================================================
--- head/net-mgmt/zabbix22-server/files/zabbix_proxy.in Sun Apr 24 10:22:47 2016 (r413934)
+++ head/net-mgmt/zabbix22-server/files/zabbix_proxy.in Sun Apr 24 11:48:26 2016 (r413935)
@@ -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: head/net-mgmt/zabbix22-server/files/zabbix_server.in
==============================================================================
--- head/net-mgmt/zabbix22-server/files/zabbix_server.in Sun Apr 24 10:22:47 2016 (r413934)
+++ head/net-mgmt/zabbix22-server/files/zabbix_server.in Sun Apr 24 11:48:26 2016 (r413935)
@@ -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: head/net-mgmt/zabbix24-server/Makefile
==============================================================================
--- head/net-mgmt/zabbix24-server/Makefile Sun Apr 24 10:22:47 2016 (r413934)
+++ head/net-mgmt/zabbix24-server/Makefile Sun Apr 24 11:48:26 2016 (r413935)
@@ -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: head/net-mgmt/zabbix24-server/files/zabbix_agentd.in
==============================================================================
--- head/net-mgmt/zabbix24-server/files/zabbix_agentd.in Sun Apr 24 10:22:47 2016 (r413934)
+++ head/net-mgmt/zabbix24-server/files/zabbix_agentd.in Sun Apr 24 11:48:26 2016 (r413935)
@@ -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: head/net-mgmt/zabbix24-server/files/zabbix_proxy.in
==============================================================================
--- head/net-mgmt/zabbix24-server/files/zabbix_proxy.in Sun Apr 24 10:22:47 2016 (r413934)
+++ head/net-mgmt/zabbix24-server/files/zabbix_proxy.in Sun Apr 24 11:48:26 2016 (r413935)
@@ -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: head/net-mgmt/zabbix24-server/files/zabbix_server.in
==============================================================================
--- head/net-mgmt/zabbix24-server/files/zabbix_server.in Sun Apr 24 10:22:47 2016 (r413934)
+++ head/net-mgmt/zabbix24-server/files/zabbix_server.in Sun Apr 24 11:48:26 2016 (r413935)
@@ -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: head/net-mgmt/zabbix3-server/Makefile
==============================================================================
--- head/net-mgmt/zabbix3-server/Makefile Sun Apr 24 10:22:47 2016 (r413934)
+++ head/net-mgmt/zabbix3-server/Makefile Sun Apr 24 11:48:26 2016 (r413935)
@@ -3,7 +3,7 @@
PORTNAME= zabbix3
PORTVERSION= 3.0.1
-PORTREVISION?= 1
+PORTREVISION?= 2
CATEGORIES= net-mgmt
MASTER_SITES= SF/zabbix/ZABBIX%20Latest%20Stable/${PORTVERSION}
PKGNAMESUFFIX?= -server
Modified: head/net-mgmt/zabbix3-server/files/zabbix_agentd.in
==============================================================================
--- head/net-mgmt/zabbix3-server/files/zabbix_agentd.in Sun Apr 24 10:22:47 2016 (r413934)
+++ head/net-mgmt/zabbix3-server/files/zabbix_agentd.in Sun Apr 24 11:48:26 2016 (r413935)
@@ -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: head/net-mgmt/zabbix3-server/files/zabbix_proxy.in
==============================================================================
--- head/net-mgmt/zabbix3-server/files/zabbix_proxy.in Sun Apr 24 10:22:47 2016 (r413934)
+++ head/net-mgmt/zabbix3-server/files/zabbix_proxy.in Sun Apr 24 11:48:26 2016 (r413935)
@@ -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: head/net-mgmt/zabbix3-server/files/zabbix_server.in
==============================================================================
--- head/net-mgmt/zabbix3-server/files/zabbix_server.in Sun Apr 24 10:22:47 2016 (r413934)
+++ head/net-mgmt/zabbix3-server/files/zabbix_server.in Sun Apr 24 11:48:26 2016 (r413935)
@@ -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"
More information about the svn-ports-head
mailing list