Lines 12-48
Link Here
|
12 |
# |
12 |
# |
13 |
# gdnsd_enable (bool): Set to NO by default. |
13 |
# gdnsd_enable (bool): Set to NO by default. |
14 |
# Set it to YES to enable gdnsd. |
14 |
# Set it to YES to enable gdnsd. |
15 |
# gdnsd_config (path): Set to %%PREFIX%%/etc/gdnsd/config |
15 |
# gdnsd_flags (str): Set to "" by default |
16 |
# by default. |
16 |
# Extra command line argument flags |
17 |
|
17 |
|
18 |
. /etc/rc.subr |
18 |
. /etc/rc.subr |
19 |
|
19 |
|
20 |
name="gdnsd" |
20 |
name="gdnsd" |
21 |
rcvar=`set_rcvar` |
21 |
rcvar=gdnsd_enable |
22 |
command="%%PREFIX%%/sbin/gdnsd" |
|
|
23 |
|
22 |
|
24 |
# set defaults |
23 |
# set defaults |
25 |
load_rc_config $name |
24 |
load_rc_config $name |
26 |
: ${gdnsd_enable:="NO"} |
25 |
: ${gdnsd_enable:="NO"} |
27 |
: ${gdnsd_config="%%PREFIX%%/etc/gdnsd/config"} |
26 |
: ${gdnsd_flags:=""} |
28 |
: ${gdnsd_pidfile="%%PREFIX%%/var/run/gdnsd.pid"} |
|
|
29 |
|
27 |
|
30 |
required_files=${gdnsd_config} |
28 |
command="%%PREFIX%%/sbin/gdnsd" |
31 |
command_args="-c ${gdnsd_config} start" |
29 |
command_args="${gdnsd_flags} start" |
32 |
procname=${command} |
30 |
procname=${command} |
33 |
extra_commands="checkconf" |
31 |
reload_cmd="gdnsd_reload" |
34 |
checkconf_cmd="gdnsd_checkconf" |
32 |
configtest_cmd="gdnsd_checkconf" |
35 |
|
33 |
extra_commands="reload configtest" |
36 |
stop_postcmd=stop_postcmd |
34 |
gdnsd_reload() |
37 |
|
|
|
38 |
stop_postcmd() |
39 |
{ |
35 |
{ |
40 |
rm -f ${gdnsd_pidfile} |
36 |
${command} ${gdnsd_flags} reload |
41 |
} |
37 |
} |
42 |
|
38 |
|
43 |
gdnsd_checkconf() |
39 |
gdnsd_checkconf() |
44 |
{ |
40 |
{ |
45 |
${command} -c ${gdnsd_config} checkconf |
41 |
${command} ${gdnsd_flags} checkconf |
46 |
} |
42 |
} |
47 |
|
43 |
|
48 |
run_rc_command "$1" |
44 |
run_rc_command "$1" |