Lines 9-18
Link Here
|
9 |
# |
9 |
# |
10 |
# zabbix_agentd_enable (bool): Set to NO by default. Set it to YES to |
10 |
# zabbix_agentd_enable (bool): Set to NO by default. Set it to YES to |
11 |
# enable zabbix_agentd. |
11 |
# enable zabbix_agentd. |
12 |
# zabbix_agentd_paths (string): Set to standard path by default. Set a search |
|
|
13 |
# if you have custom userparams that need binaries elsewhere. |
14 |
# zabbix_agentd_config (string): Set to the standard config file path by |
12 |
# zabbix_agentd_config (string): Set to the standard config file path by |
15 |
# default. |
13 |
# default. |
|
|
14 |
# zabbix_agentd_pidfile (string): Location of the asterisk pid file |
15 |
# Default is /var/run/zabbix/zabbix_agentd.pid |
16 |
# |
16 |
# |
17 |
|
17 |
|
18 |
. /etc/rc.subr |
18 |
. /etc/rc.subr |
Lines 22-43
Link Here
|
22 |
|
22 |
|
23 |
load_rc_config $name |
23 |
load_rc_config $name |
24 |
|
24 |
|
25 |
: ${zabbix_agentd_enable="NO"} |
25 |
: ${zabbix_agentd_enable:=NO} |
26 |
: ${zabbix_agentd_paths=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin} |
26 |
: ${zabbix_agentd_config:=%%ETCDIR%%/${name}.conf} |
27 |
: ${zabbix_agentd_config="%%ETCDIR%%/${name}.conf"} |
27 |
: ${zabbix_agentd_pidfile:=/var/run/zabbix/zabbix_agentd.pid} |
28 |
|
28 |
|
29 |
command="%%PREFIX%%/sbin/${name}" |
29 |
command="%%PREFIX%%/sbin/${name}" |
30 |
required_files="${zabbix_agentd_config}" |
30 |
required_files="${zabbix_agentd_config}" |
31 |
start_precmd="find_pidfile" |
|
|
32 |
status_precmd="find_pidfile" |
33 |
stop_precmd="find_pidfile" |
34 |
|
31 |
|
35 |
find_pidfile() |
32 |
start_precmd=zabbix_agentd_precmd |
|
|
33 |
status_precmd=zabbix_agentd_precmd |
34 |
stop_precmd=zabbix_agentd_precmd |
35 |
|
36 |
zabbix_agentd_precmd() |
36 |
{ |
37 |
{ |
37 |
if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then |
38 |
if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then |
38 |
pidfile="$_pidfile_from_conf" |
39 |
pidfile="$_pidfile_from_conf" |
39 |
else |
40 |
else |
40 |
pidfile="/tmp/${name}.pid" |
41 |
pidfile=${zabbix_agentd_pidfile} |
|
|
42 |
local rundir=${zabbix_agentd_pidfile%/*} |
43 |
if [ ! -d $rundir ] ; then |
44 |
install -d -m 0755 -o zabbix -g zabbix $rundir |
45 |
fi |
41 |
fi |
46 |
fi |
42 |
|
47 |
|
43 |
# This shouldn't be necessary with pidfile, but empirically it was the |
48 |
# This shouldn't be necessary with pidfile, but empirically it was the |
Lines 47-52
Link Here
|
47 |
rc_pid=$(check_pidfile ${pidfile} ${command}) |
52 |
rc_pid=$(check_pidfile ${pidfile} ${command}) |
48 |
} |
53 |
} |
49 |
|
54 |
|
50 |
export PATH="${zabbix_agentd_paths}" |
|
|
51 |
|
52 |
run_rc_command "$1" |
55 |
run_rc_command "$1" |