Remove references to set_rcvar, which has been removed from 10-current.
While I'm here, bring some consistency to the various example rc.d scripts, remove some bad examples, etc.
This commit is contained in:
parent
09d84b2924
commit
58189f49fe
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=38233
16 changed files with 115 additions and 187 deletions
de_DE.ISO8859-1/books/handbook/config
el_GR.ISO8859-7/books/handbook/config
en_US.ISO8859-1
fr_FR.ISO8859-1/books/handbook/config
hu_HU.ISO8859-2/books/handbook/config
it_IT.ISO8859-15/books/handbook/config
ja_JP.eucJP/man/man8
mn_MN.UTF-8/books/handbook/config
nl_NL.ISO8859-1/books/handbook/config
pl_PL.ISO8859-2/books/handbook/config
ru_RU.KOI8-R/books/handbook/config
zh_CN.GB2312
zh_TW.Big5/books/handbook/config
|
@ -410,11 +410,11 @@ ifconfig_fxp0="inet 10.1.1.1/8"</programlisting></listitem>
|
|||
# REQUIRE: DAEMON
|
||||
# KEYWORD: shutdown
|
||||
|
||||
|
||||
./etc/rc.subr
|
||||
|
||||
name="utility"
|
||||
rcvar=`set_rcvar`
|
||||
name=utility
|
||||
rcvar=utility_enable
|
||||
|
||||
command="/usr/local/sbin/utility"
|
||||
|
||||
load_rc_config $name
|
||||
|
@ -424,9 +424,7 @@ load_rc_config $name
|
|||
# SET THEM IN THE /etc/rc.conf FILE
|
||||
#
|
||||
utility_enable=${utility_enable-"NO"}
|
||||
utility_pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
pidfile="${utility_pidfile}"
|
||||
pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
run_rc_command "$1"</programlisting>
|
||||
|
||||
|
|
|
@ -446,25 +446,21 @@ exit 0</programlisting>
|
|||
# REQUIRE: DAEMON
|
||||
# KEYWORD: shutdown
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name=utility
|
||||
rcvar=utility_enable
|
||||
|
||||
command="/usr/local/sbin/utility"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
#
|
||||
# DO NOT CHANGE THESE DEFAULT VALUES HERE
|
||||
# SET THEM IN THE /etc/rc.conf FILE
|
||||
#
|
||||
utility_enable=${utility_enable-"NO"}
|
||||
utility_flags=${utility_flags-""}
|
||||
utility_pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="utility"
|
||||
rcvar=`set_rcvar`
|
||||
command="/usr/local/sbin/utility"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
pidfile="${utility_pidfile}"
|
||||
|
||||
start_cmd="echo \"Starting ${name}.\"; /usr/bin/nice -5 ${command} ${utility_flags} ${command_args}"
|
||||
pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
run_rc_command "$1"</programlisting>
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
|
||||
<copyright>
|
||||
<year>2005</year>
|
||||
|
||||
<year>2006</year>
|
||||
<year>2012</year>
|
||||
|
||||
<holder>The FreeBSD Project</holder>
|
||||
</copyright>
|
||||
|
@ -389,8 +389,9 @@ run_rc_command "$1"<co id="rcng-dummy-runcommand"></programlisting>
|
|||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="dummy"
|
||||
rcvar=`set_rcvar`<co id="rcng-confdummy-rcvar">
|
||||
name=dummy
|
||||
rcvar=dummy_enable<co id="rcng-confdummy-rcvar">
|
||||
|
||||
start_cmd="${name}_start"
|
||||
stop_cmd=":"
|
||||
|
||||
|
@ -411,17 +412,7 @@ run_rc_command "$1"</programlisting>
|
|||
<calloutlist>
|
||||
<callout arearefs="rcng-confdummy-rcvar">
|
||||
<para>The variable <envar>rcvar</envar> specifies
|
||||
the name of the ON/OFF knob variable. The reason to
|
||||
obtain the variable name from &man.rc.subr.8; by calling
|
||||
<function>set_rcvar</function> is that different operating
|
||||
systems adopted different conventions for it. Namely,
|
||||
&os; sticks to the
|
||||
<envar>${name}_enable</envar>
|
||||
scheme while NetBSD uses just
|
||||
<envar>${name}</envar> variables in its &man.rc.conf.5;.
|
||||
For example, our script will be controlled by
|
||||
<envar>dummy_enable</envar> in &os; and by <envar>dummy</envar>
|
||||
in NetBSD.</para>
|
||||
the name of the ON/OFF knob variable.</para>
|
||||
</callout>
|
||||
|
||||
<callout arearefs="rcng-confdummy-loadconfig">
|
||||
|
@ -537,8 +528,9 @@ run_rc_command "$1"</programlisting>
|
|||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="mumbled"
|
||||
rcvar=`set_rcvar`
|
||||
name=mumbled
|
||||
rcvar=mumbled_enable
|
||||
|
||||
command="/usr/sbin/${name}"<co id="rcng-daemon-basic-cmd">
|
||||
|
||||
load_rc_config $name
|
||||
|
@ -629,8 +621,8 @@ run_rc_command "$1"</programlisting>
|
|||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="mumbled"
|
||||
rcvar=`set_rcvar`
|
||||
name=mumbled
|
||||
rcvar=mumbled_enable
|
||||
|
||||
command="/usr/sbin/${name}"
|
||||
command_args="mock arguments > /dev/null 2>&1"<co id="rcng-daemon-adv-args">
|
||||
|
@ -1014,8 +1006,9 @@ fi</programlisting>
|
|||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="mumbled"
|
||||
rcvar=`set_rcvar`
|
||||
name=mumbled
|
||||
rcvar=mumbled_enable
|
||||
|
||||
command="/usr/sbin/${name}"
|
||||
start_precmd="${name}_prestart"
|
||||
|
||||
|
|
|
@ -384,8 +384,9 @@ ifconfig_fxp0="inet 10.1.1.1/8"</programlisting></listitem>
|
|||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="utility"
|
||||
rcvar=`set_rcvar`
|
||||
name=utility
|
||||
rcvar=utility_enable
|
||||
|
||||
command="/usr/local/sbin/utility"
|
||||
|
||||
load_rc_config $name
|
||||
|
@ -395,9 +396,7 @@ load_rc_config $name
|
|||
# SET THEM IN THE /etc/rc.conf FILE
|
||||
#
|
||||
utility_enable=${utility_enable-"NO"}
|
||||
utility_pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
pidfile="${utility_pidfile}"
|
||||
pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
run_rc_command "$1"</programlisting>
|
||||
|
||||
|
|
|
@ -519,25 +519,21 @@ exit 0</programlisting>
|
|||
# REQUIRE: DAEMON
|
||||
# KEYWORD: shutdown
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name=utility
|
||||
rcvar=utility_enable
|
||||
|
||||
command="/usr/local/sbin/utility"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
#
|
||||
# DO NOT CHANGE THESE DEFAULT VALUES HERE
|
||||
# SET THEM IN THE /etc/rc.conf FILE
|
||||
#
|
||||
utility_enable=${utility_enable-"NO"}
|
||||
utility_flags=${utility_flags-""}
|
||||
utility_pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="utility"
|
||||
rcvar=`set_rcvar`
|
||||
command="/usr/local/sbin/utility"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
pidfile="${utility_pidfile}"
|
||||
|
||||
start_cmd="echo \"Starting ${name}.\"; /usr/bin/nice -5 ${command} ${utility_flags} ${command_args}"
|
||||
pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
run_rc_command "$1"</programlisting>
|
||||
|
||||
|
|
|
@ -553,8 +553,9 @@
|
|||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="utility"
|
||||
rcvar=`set_rcvar`
|
||||
name=utility
|
||||
rcvar=utility_enable
|
||||
|
||||
command="/usr/local/sbin/utility"
|
||||
|
||||
load_rc_config $name
|
||||
|
@ -564,9 +565,7 @@ load_rc_config $name
|
|||
# INKÁBB AZ /etc/rc.conf ÁLLOMÁNYBAN ÁLLÍTSUK BE EZEKET
|
||||
#
|
||||
utility_enable=${utility_enable-"NO"}
|
||||
utility_pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
pidfile="${utility_pidfile}"
|
||||
pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
run_rc_command "$1"</programlisting>
|
||||
|
||||
|
|
|
@ -455,25 +455,21 @@ exit 0</programlisting>
|
|||
# REQUIRE: DAEMON
|
||||
# KEYWORD: shutdown
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name=utility
|
||||
rcvar=utility_enable
|
||||
|
||||
command="/usr/local/sbin/utility"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
#
|
||||
# DO NOT CHANGE THESE DEFAULT VALUES HERE
|
||||
# SET THEM IN THE /etc/rc.conf FILE
|
||||
#
|
||||
utility_enable=${utility_enable-"NO"}
|
||||
utility_flags=${utility_flags-""}
|
||||
utility_pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="utility"
|
||||
rcvar=`set_rcvar`
|
||||
command="/usr/local/sbin/utility"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
pidfile="${utility_pidfile}"
|
||||
|
||||
start_cmd="echo \"Starting ${name}.\"; /usr/bin/nice -5 ${command} ${utility_flags} ${command_args}"
|
||||
pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
run_rc_command "$1"</programlisting>
|
||||
|
||||
|
|
|
@ -471,8 +471,9 @@ PVC
|
|||
|
||||
\&. /etc/rc.subr
|
||||
|
||||
name="foo"
|
||||
rcvar=`set_rcvar`
|
||||
name=foo
|
||||
rcvar=foo_enable
|
||||
|
||||
command="/usr/local/bin/foo"
|
||||
|
||||
load_rc_config $name
|
||||
|
@ -492,8 +493,9 @@ run_rc_command "$1"
|
|||
|
||||
\&. /etc/rc.subr
|
||||
|
||||
name="foo"
|
||||
rcvar=`set_rcvar`
|
||||
name=foo
|
||||
rcvar=foo_enable
|
||||
|
||||
command="/usr/local/bin/foo"
|
||||
extra_commands="nop hello"
|
||||
hello_cmd="echo Hello World."
|
||||
|
|
|
@ -77,8 +77,6 @@
|
|||
.It
|
||||
.Ic run_rc_script Ar file Ar argument
|
||||
.It
|
||||
.Ic set_rcvar Op Ar base
|
||||
.It
|
||||
.Ic wait_for_pids Op Ar pid ...
|
||||
.It
|
||||
.Ic warn Ar message
|
||||
|
@ -712,34 +710,6 @@ fast
|
|||
.Ar file
|
||||
を読み込みます。
|
||||
.El
|
||||
.It Ic set_rcvar Op Ar base
|
||||
サービスを起動させるために必要な変数名を設定します。
|
||||
通常
|
||||
.Fx
|
||||
では、デーモンの名称に文字列
|
||||
.Dq Li "_enable"
|
||||
を後置した
|
||||
.Xr rc.conf 5
|
||||
変数により、デーモンが制御されます。
|
||||
これは
|
||||
.Nx
|
||||
には当てはまりません。
|
||||
次のような行がスクリプト中にある場合、
|
||||
.Pp
|
||||
.Dl "rcvar=`set_rcvar`"
|
||||
.Pp
|
||||
この関数は適切な
|
||||
.Xr rc.conf 5
|
||||
ノブを作成するために、呼び出し側のスクリプトで定義されているべき変数
|
||||
.Va $name
|
||||
の値を使用します。
|
||||
引数
|
||||
.Ar base
|
||||
が設定されている場合は、
|
||||
.Va $name
|
||||
の代わりに
|
||||
.Ar base
|
||||
を使用します。
|
||||
.It Ic wait_for_pids Op Ar pid ...
|
||||
指定された全ての
|
||||
.Ar pid
|
||||
|
|
|
@ -367,8 +367,9 @@ ifconfig_fxp0="inet 10.1.1.1/8"</programlisting></listitem>
|
|||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="utility"
|
||||
rcvar=`set_rcvar`
|
||||
name=utility
|
||||
rcvar=utility_enable
|
||||
|
||||
command="/usr/local/sbin/utility"
|
||||
|
||||
load_rc_config $name
|
||||
|
@ -378,9 +379,7 @@ load_rc_config $name
|
|||
# SET THEM IN THE /etc/rc.conf FILE
|
||||
#
|
||||
utility_enable=${utility_enable-"NO"}
|
||||
utility_pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
pidfile="${utility_pidfile}"
|
||||
pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
run_rc_command "$1"</programlisting>
|
||||
|
||||
|
|
|
@ -429,8 +429,9 @@ ifconfig_fxp0="inet 10.1.1.1/8"</programlisting></listitem>
|
|||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="utility"
|
||||
rcvar=`set_rcvar`
|
||||
name=utility
|
||||
rcvar=utility_enable
|
||||
|
||||
command="/usr/local/sbin/utility"
|
||||
|
||||
load_rc_config $name
|
||||
|
@ -440,9 +441,7 @@ load_rc_config $name
|
|||
# STEL ZE IN IN HET BESTAND /etc/rc.conf
|
||||
#
|
||||
utility_enable=${utility_enable-"NO"}
|
||||
utility_pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
pidfile="${utility_pidfile}"
|
||||
pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
run_rc_command "$1"</programlisting>
|
||||
|
||||
|
|
|
@ -432,25 +432,21 @@ exit 0</programlisting>
|
|||
# REQUIRE: DAEMON
|
||||
# KEYWORD: shutdown
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name=utility
|
||||
rcvar=utility_enable
|
||||
|
||||
command="/usr/local/sbin/utility"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
#
|
||||
# DO NOT CHANGE THESE DEFAULT VALUES HERE
|
||||
# SET THEM IN THE /etc/rc.conf FILE
|
||||
#
|
||||
utility_enable=${utility_enable-"NO"}
|
||||
utility_flags=${utility_flags-""}
|
||||
utility_pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="utility"
|
||||
rcvar=`set_rcvar`
|
||||
command="/usr/local/sbin/utility"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
pidfile="${utility_pidfile}"
|
||||
|
||||
start_cmd="echo \"Starting ${name}.\"; /usr/bin/nice -5 ${command} ${utility_flags} ${command_args}"
|
||||
pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
run_rc_command "$1"</programlisting>
|
||||
|
||||
|
|
|
@ -439,27 +439,21 @@ exit 0</programlisting>
|
|||
# REQUIRE: DAEMON
|
||||
# KEYWORD: shutdown
|
||||
|
||||
#
|
||||
# îå íåîñêôå úäåóø üôé óôáîäáòôîùå úîáþåîéñ
|
||||
# úáäá÷áêôå éè ÷ æáêìå /etc/rc.conf
|
||||
|
||||
#
|
||||
|
||||
utility_enable=${utility_enable-"NO"}
|
||||
utility_flags=${utility_flags-""}
|
||||
utility_pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="utility"
|
||||
rcvar=`set_rcvar`
|
||||
name=utility
|
||||
rcvar=utility_pidfile
|
||||
|
||||
command="/usr/local/sbin/utility"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
pidfile="${utility_pidfile}"
|
||||
|
||||
start_cmd="echo \"Starting ${name}.\"; /usr/bin/nice -5 ${command} ${utility_flags} ${command_args}"
|
||||
#
|
||||
# îå íåîñêôå úäåóø üôé óôáîäáòôîùå úîáþåîéñ
|
||||
# úáäá÷áêôå éè ÷ æáêìå /etc/rc.conf
|
||||
#
|
||||
utility_enable=${utility_enable-"NO"}
|
||||
pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
run_rc_command "$1"</programlisting>
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
|
||||
<copyright>
|
||||
<year>2005</year>
|
||||
|
||||
<year>2006</year>
|
||||
<year>2012</year>
|
||||
|
||||
<holder>The FreeBSD Project</holder>
|
||||
</copyright>
|
||||
|
@ -347,8 +347,9 @@ run_rc_command "$1"<co id="rcng-dummy-runcommand"></programlisting>
|
|||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="dummy"
|
||||
rcvar=`set_rcvar`<co id="rcng-confdummy-rcvar">
|
||||
name=dummy
|
||||
rcvar=dummy_enable<co id="rcng-confdummy-rcvar">
|
||||
|
||||
start_cmd="${name}_start"
|
||||
stop_cmd=":"
|
||||
|
||||
|
@ -369,14 +370,7 @@ run_rc_command "$1"</programlisting>
|
|||
<calloutlist>
|
||||
<callout arearefs="rcng-confdummy-rcvar">
|
||||
<para>±äÁ¿ <envar>rcvar</envar> Ö¸¶¨ÁË ON/OFF
|
||||
开关变量的名字。包含来自 &man.rc.subr.8;
|
||||
中变量名是为了调用不同操作系统所采用的不同规定的
|
||||
<function>set_rcvar</function>。也就是说,&os; 坚持使用
|
||||
<envar>${name}_enable</envar> 样式而 NetBSD 的
|
||||
&man.rc.conf.5; 中使用的只是 <envar>${name}</envar>
|
||||
变量的形式。例如,我们在 &os; 中使用
|
||||
<envar>dummy_enable</envar> 来控制我们的脚本而在
|
||||
NetBSD 中使用 <envar>dummy</envar> 来控制。</para>
|
||||
开关变量的名字。包含来自</para>
|
||||
</callout>
|
||||
|
||||
<callout arearefs="rcng-confdummy-loadconfig">
|
||||
|
@ -479,8 +473,9 @@ run_rc_command "$1"</programlisting>
|
|||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="mumbled"
|
||||
rcvar=`set_rcvar`
|
||||
name=mumbled
|
||||
rcvar=mumbled_enable
|
||||
|
||||
command="/usr/sbin/${name}"<co id="rcng-daemon-basic-cmd">
|
||||
|
||||
load_rc_config $name
|
||||
|
@ -563,8 +558,8 @@ run_rc_command "$1"</programlisting>
|
|||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="mumbled"
|
||||
rcvar=`set_rcvar`
|
||||
name=mumbled
|
||||
rcvar=mumbled_enable
|
||||
|
||||
command="/usr/sbin/${name}"
|
||||
command_args="mock arguments > /dev/null 2>&1"<co id="rcng-daemon-adv-args">
|
||||
|
@ -903,8 +898,9 @@ fi</programlisting>
|
|||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="mumbled"
|
||||
rcvar=`set_rcvar`
|
||||
name=mumbled
|
||||
rcvar=mumbled_enable
|
||||
|
||||
command="/usr/sbin/${name}"
|
||||
start_precmd="${name}_prestart"
|
||||
|
||||
|
|
|
@ -336,8 +336,9 @@ ifconfig_fxp0="inet 10.1.1.1/8"</programlisting></listitem>
|
|||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="utility"
|
||||
rcvar=`set_rcvar`
|
||||
name=utility
|
||||
rcvar=utility_enable
|
||||
|
||||
command="/usr/local/sbin/utility"
|
||||
|
||||
load_rc_config $name
|
||||
|
@ -347,9 +348,7 @@ load_rc_config $name
|
|||
# SET THEM IN THE /etc/rc.conf FILE
|
||||
#
|
||||
utility_enable=${utility_enable-"NO"}
|
||||
utility_pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
pidfile="${utility_pidfile}"
|
||||
pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
run_rc_command "$1"</programlisting>
|
||||
|
||||
|
|
|
@ -394,25 +394,21 @@ exit 0</programlisting>
|
|||
# REQUIRE: DAEMON
|
||||
# KEYWORD: shutdown
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name=utility
|
||||
rcvar=utility_pidfile
|
||||
|
||||
command="/usr/local/sbin/utility"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
#
|
||||
# DO NOT CHANGE THESE DEFAULT VALUES HERE
|
||||
# SET THEM IN THE /etc/rc.conf FILE
|
||||
#
|
||||
utility_enable=${utility_enable-"NO"}
|
||||
utility_flags=${utility_flags-""}
|
||||
utility_pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="utility"
|
||||
rcvar=`set_rcvar`
|
||||
command="/usr/local/sbin/utility"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
pidfile="${utility_pidfile}"
|
||||
|
||||
start_cmd="echo \"Starting ${name}.\"; /usr/bin/nice -5 ${command} ${utility_flags} ${command_args}"
|
||||
pidfile=${utility_pidfile-"/var/run/utility.pid"}
|
||||
|
||||
run_rc_command "$1"</programlisting>
|
||||
|
||||
|
|
Loading…
Reference in a new issue