Lines 9-14
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 |
15 |
# default. |
12 |
# |
16 |
# |
13 |
|
17 |
|
14 |
. /etc/rc.subr |
18 |
. /etc/rc.subr |
Lines 16-26
Link Here
|
16 |
name="zabbix_agentd" |
20 |
name="zabbix_agentd" |
17 |
rcvar=zabbix_agentd_enable |
21 |
rcvar=zabbix_agentd_enable |
18 |
|
22 |
|
19 |
command="%%PREFIX%%/sbin/${name}" |
|
|
20 |
required_files="%%ETCDIR%%/${name}.conf" |
21 |
|
22 |
load_rc_config $name |
23 |
load_rc_config $name |
23 |
|
24 |
|
24 |
: ${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} |
27 |
: ${zabbix_agentd_config="%%ETCDIR%%/${name}.conf"} |
28 |
|
29 |
command="%%PREFIX%%/sbin/${name}" |
30 |
required_files="${zabbix_agentd_config}" |
31 |
start_precmd="find_pidfile" |
32 |
status_precmd="find_pidfile" |
33 |
stop_precmd="find_pidfile" |
34 |
|
35 |
find_pidfile() |
36 |
{ |
37 |
if get_pidfile_from_conf PidFile ${zabbix_agentd_config}; then |
38 |
pidfile="$_pidfile_from_conf" |
39 |
else |
40 |
pidfile="/tmp/${name}.pid" |
41 |
fi |
42 |
|
43 |
# This shouldn't be necessary with pidfile, but empirically it was the |
44 |
# only way to reap the parent PID instead of all PIDs from |
45 |
# check_process, which may leak SysV IPC objects and prevent restart |
46 |
# and/or race condition on restart. |
47 |
rc_pid=$(check_pidfile ${pidfile} ${command}) |
48 |
} |
49 |
|
50 |
export PATH="${zabbix_agentd_paths}" |
25 |
|
51 |
|
26 |
run_rc_command "$1" |
52 |
run_rc_command "$1" |