Lines 17-40
Link Here
|
17 |
|
17 |
|
18 |
required_files=%%PREFIX%%/etc/nsd/nsd.conf |
18 |
required_files=%%PREFIX%%/etc/nsd/nsd.conf |
19 |
|
19 |
|
20 |
command=%%PREFIX%%/sbin/${name} |
20 |
command=%%PREFIX%%/sbin/nsdc |
21 |
pidfile=`%%PREFIX%%/sbin/nsd-checkconf -o pidfile %%PREFIX%%/etc/nsd/nsd.conf` |
21 |
pidfile=`%%PREFIX%%/sbin/nsd-checkconf -o pidfile %%PREFIX%%/etc/nsd/nsd.conf` |
22 |
|
22 |
|
23 |
load_rc_config ${name} |
23 |
load_rc_config ${name} |
24 |
|
24 |
|
25 |
nsd_enable=${nsd_enable-"NO"} |
25 |
nsd_enable=${nsd_enable-"NO"} |
26 |
|
26 |
|
|
|
27 |
extra_commands="reload" |
28 |
start_precmd="nsd_precmd" |
29 |
status_cmd="nsd_status" |
30 |
start_cmd="nsd_start" |
31 |
reload_cmd="nsd_reload" |
27 |
stop_cmd="nsd_stop" |
32 |
stop_cmd="nsd_stop" |
28 |
|
33 |
|
|
|
34 |
nsd_precmd() |
35 |
{ |
36 |
db=`%%PREFIX%%/sbin/nsd-checkconf -o database %%PREFIX%%/etc/nsd/nsd.conf` |
37 |
if [ ! -f "$db" ]; then |
38 |
${command} rebuild |
39 |
fi |
40 |
} |
41 |
|
42 |
nsd_status() |
43 |
{ |
44 |
${command} running && echo "nsd running pid `head -n 1 ${pidfile}`" |
45 |
} |
46 |
|
47 |
nsd_start() |
48 |
{ |
49 |
echo "Starting nsd." |
50 |
${command} start |
51 |
} |
52 |
|
53 |
nsd_reload() |
54 |
{ |
55 |
${command} rebuild && ${command} reload |
56 |
} |
57 |
|
29 |
nsd_stop() |
58 |
nsd_stop() |
30 |
{ |
59 |
{ |
31 |
echo "Merging nsd zone transfer changes to zone files." |
60 |
echo "Merging nsd zone transfer changes to zone files." |
32 |
%%PREFIX%%/sbin/nsdc patch |
61 |
${command} patch |
33 |
|
|
|
34 |
sleep 5 |
35 |
|
62 |
|
36 |
echo "Stopping nsd." |
63 |
echo "Stopping nsd." |
37 |
%%PREFIX%%/sbin/nsdc stop |
64 |
${command} stop |
38 |
} |
65 |
} |
39 |
|
66 |
|
40 |
run_rc_command "$1" |
67 |
run_rc_command "$1" |