aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/zabbix2-server/files
diff options
context:
space:
mode:
authorLars Engels <lme@FreeBSD.org>2016-04-24 11:48:26 +0000
committerLars Engels <lme@FreeBSD.org>2016-04-24 11:48:26 +0000
commit91a3d6f021f0fe62de4379a64dc1b7136fd6eeeb (patch)
tree4ebdbfd0ba961d25cb8ce7c2d7431a88115f2557 /net-mgmt/zabbix2-server/files
parent8923875bb74ad25213b2a09b7ebe2502688ee629 (diff)
Notes
Diffstat (limited to 'net-mgmt/zabbix2-server/files')
-rw-r--r--net-mgmt/zabbix2-server/files/zabbix_agentd.in32
-rw-r--r--net-mgmt/zabbix2-server/files/zabbix_proxy.in33
-rw-r--r--net-mgmt/zabbix2-server/files/zabbix_server.in32
3 files changed, 88 insertions, 9 deletions
diff --git a/net-mgmt/zabbix2-server/files/zabbix_agentd.in b/net-mgmt/zabbix2-server/files/zabbix_agentd.in
index 4af7fa72f13f..ddff711848b5 100644
--- a/net-mgmt/zabbix2-server/files/zabbix_agentd.in
+++ b/net-mgmt/zabbix2-server/files/zabbix_agentd.in
@@ -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"
diff --git a/net-mgmt/zabbix2-server/files/zabbix_proxy.in b/net-mgmt/zabbix2-server/files/zabbix_proxy.in
index 58898c6ecd3a..407c7313655a 100644
--- a/net-mgmt/zabbix2-server/files/zabbix_proxy.in
+++ b/net-mgmt/zabbix2-server/files/zabbix_proxy.in
@@ -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"
diff --git a/net-mgmt/zabbix2-server/files/zabbix_server.in b/net-mgmt/zabbix2-server/files/zabbix_server.in
index 4e381a6ff894..50cfe3f37a73 100644
--- a/net-mgmt/zabbix2-server/files/zabbix_server.in
+++ b/net-mgmt/zabbix2-server/files/zabbix_server.in
@@ -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"