Lines 20-47
Link Here
|
20 |
globalconf=${cbsd_globalconf:-"${workdir}/cbsd.conf"} |
20 |
globalconf=${cbsd_globalconf:-"${workdir}/cbsd.conf"} |
21 |
|
21 |
|
22 |
if [ ! -f ${globalconf} ]; then |
22 |
if [ ! -f ${globalconf} ]; then |
23 |
echo "cbsd: no such ${globalconf}"; |
23 |
echo "cbsd: no such ${globalconf}"; |
24 |
exit 1 |
24 |
exit 1 |
25 |
fi |
25 |
fi |
26 |
|
26 |
|
27 |
if [ ! -f ${inventory} ]; then |
27 |
if [ ! -f ${inventory} ]; then |
28 |
echo "cbsd: no such ${inventory}"; |
28 |
echo "cbsd: no such ${inventory}"; |
29 |
exit 1 |
29 |
exit 1 |
30 |
fi |
30 |
fi |
31 |
|
31 |
|
32 |
if [ ! -f ${mdtools} ]; then |
32 |
if [ ! -f ${mdtools} ]; then |
33 |
echo "cbsd: no such ${mdtools}"; |
33 |
echo "cbsd: no such ${mdtools}"; |
34 |
exit 1 |
34 |
exit 1 |
35 |
fi |
35 |
fi |
36 |
|
36 |
|
37 |
if [ ! -f ${subr} ]; then |
37 |
if [ ! -f ${subr} ]; then |
38 |
echo "cbsd: no such ${subr}"; |
38 |
echo "cbsd: no such ${subr}"; |
39 |
exit 1 |
39 |
exit 1 |
40 |
fi |
40 |
fi |
41 |
|
41 |
|
42 |
if [ ! -f ${localcbsdconf} ]; then |
42 |
if [ ! -f ${localcbsdconf} ]; then |
43 |
echo "cbsd: no such ${localcbsdconf}"; |
43 |
echo "cbsd: no such ${localcbsdconf}"; |
44 |
exit 1 |
44 |
exit 1 |
45 |
fi |
45 |
fi |
46 |
|
46 |
|
47 |
. ${globalconf} |
47 |
. ${globalconf} |
Lines 53-77
Link Here
|
53 |
|
53 |
|
54 |
start_precmd=${name}_prestart |
54 |
start_precmd=${name}_prestart |
55 |
stop_precmd=${name}_prestop |
55 |
stop_precmd=${name}_prestop |
|
|
56 |
stop_cmd=${name}_stop |
56 |
|
57 |
|
57 |
command="${sbindir}/cbsdd" |
58 |
command="${toolsdir}/cbsdd" |
58 |
pidfile="/var/run/$name.pid" |
59 |
pidfile="/var/run/$name.pid" |
|
|
60 |
command_args="&" |
59 |
|
61 |
|
60 |
cbsdd_prestart() { |
62 |
cbsdd_prestart() { |
61 |
find ${ftmpdir} -depth 1 -maxdepth 1 -type f -exec rm -f {} \; |
63 |
/usr/bin/find ${ftmpdir} -depth 1 -maxdepth 1 -type f -exec rm -f {} \; |
62 |
%%PREFIX%%/bin/cbsd sysinv mode=update |
64 |
%%PREFIX%%/bin/cbsd sysinv mode=update |
63 |
%%PREFIX%%/bin/cbsd netinv |
65 |
%%PREFIX%%/bin/cbsd netinv |
64 |
|
66 |
|
65 |
. ${inventory} |
67 |
. ${inventory} |
66 |
|
68 |
|
67 |
[ -n "$nat_enable" ] && %%PREFIX%%/bin/cbsd naton |
69 |
[ -n "$nat_enable" ] && %%PREFIX%%/bin/cbsd naton |
68 |
/usr/sbin/daemon ${rcddir}/jails-astart start |
70 |
/usr/sbin/daemon ${rcddir}/jails-astart start |
69 |
} |
71 |
} |
70 |
|
72 |
|
71 |
cbsdd_prestop() |
73 |
cbsdd_prestop() |
72 |
{ |
74 |
{ |
73 |
${rcddir}/jails-astart stop |
75 |
${rcddir}/jails-astart stop |
74 |
[ -n "${nat_enable}" ] && %%PREFIX%%/bin/cbsd natoff |
76 |
[ -n "${nat_enable}" ] && %%PREFIX%%/bin/cbsd natoff |
|
|
77 |
} |
78 |
|
79 |
cbsdd_stop() |
80 |
{ |
81 |
[ -f "${pidfile}" ] && kill -9 $( cat ${pidfile} ) |
75 |
} |
82 |
} |
76 |
|
83 |
|
77 |
run_rc_command "$1" |
84 |
run_rc_command "$1" |