|
Lines 17-36
Link Here
|
| 17 |
|
17 |
|
| 18 |
. /etc/rc.subr |
18 |
. /etc/rc.subr |
| 19 |
|
19 |
|
| 20 |
name=hfm |
20 |
name="hfm" |
| 21 |
rcvar=hfm_enable |
21 |
rcvar="hfm_enable" |
| 22 |
|
22 |
|
| 23 |
command="%%PREFIX%%/bin/${name}" |
23 |
command="%%PREFIX%%/bin/${name}" |
| 24 |
|
24 |
|
| 25 |
hfm_user=_hfm |
25 |
hfm_user="_hfm" |
| 26 |
hfm_flags=${hfm_flags:-"-config %%ETCDIR%%/${name}.conf -facility local0 -log syslog"} |
26 |
hfm_flags="${hfm_flags:-"-config %%ETCDIR%%/${name}.conf -facility local0 -log syslog"}" |
| 27 |
|
27 |
|
| 28 |
pidfile="/var/run/${name}.pid" |
28 |
pidfile="/var/run/${name}.pid" |
| 29 |
|
29 |
|
| 30 |
required_files="%%ETCDIR%%/${name}.conf" |
30 |
required_files="%%ETCDIR%%/${name}.conf" |
| 31 |
|
31 |
|
| 32 |
start_cmd=hfm_start |
32 |
start_cmd="hfm_start" |
| 33 |
stop_postcmd=hfm_postcmd |
33 |
restart_precmd="hfm_checkconfig" |
|
|
34 |
configtest_cmd="hfm_checkconfig" |
| 35 |
stop_postcmd="hfm_postcmd" |
| 36 |
|
| 37 |
hfm_checkconfig() { |
| 38 |
eval ${command} ${hfm_flags} -n |
| 39 |
} |
| 34 |
|
40 |
|
| 35 |
hfm_start() { |
41 |
hfm_start() { |
| 36 |
echo "Staring ${name}." |
42 |
echo "Staring ${name}." |
|
Lines 42-47
Link Here
|
| 42 |
[ -f ${pidfile} ] && rm ${pidfile} |
48 |
[ -f ${pidfile} ] && rm ${pidfile} |
| 43 |
} |
49 |
} |
| 44 |
|
50 |
|
| 45 |
load_rc_config $name |
51 |
extra_commands="configtest" |
|
|
52 |
load_rc_config "${name}" |
| 46 |
run_rc_command "$1" |
53 |
run_rc_command "$1" |
| 47 |
|
54 |
|