Source string Read only

(itstool) path: callout/para
385/3850
Context English State
#!/bin/sh

# PROVIDE: mumbled oldmumble <co xml:id="rcng-hookup-provide"/>
# REQUIRE: DAEMON cleanvar frotz<co xml:id="rcng-hookup-require"/>
# BEFORE: LOGIN<co xml:id="rcng-hookup-before"/>
# KEYWORD: nojail shutdown<co xml:id="rcng-hookup-keyword"/>

. /etc/rc.subr

name=mumbled
rcvar=mumbled_enable

command="/usr/sbin/${name}"
start_precmd="${name}_prestart"

mumbled_prestart()
{
if ! checkyesno frotz_enable &amp;&amp; \
! /etc/rc.d/frotz forcestatus 1&gt;/dev/null 2&gt;&amp;1; then
force_depend frotz || return 1<co xml:id="rcng-hookup-force"/>
fi
return 0
}

load_rc_config $name
run_rc_command "$1"
As before, detailed analysis follows:
That line declares the names of <quote>conditions</quote> our script provides. Now other scripts can record a dependency on our script by those names.
Usually a script specifies a single condition provided. However, nothing prevents us from listing several conditions there, e.g., for compatibility reasons.
In any case, the name of the main, or the only, <literal>PROVIDE:</literal> condition should be the same as <envar>${name}</envar>.
So our script indicates which <quote>conditions</quote> provided by other scripts it depends on. According to the lines, our script asks <citerefentry><refentrytitle>rcorder</refentrytitle><manvolnum>8</manvolnum></citerefentry> to put it after the script(s) providing <filename>DAEMON</filename> and <filename>cleanvar</filename>, but before that providing <filename>LOGIN</filename>.
The <literal>BEFORE:</literal> line should not be abused to work around an incomplete dependency list in the other script. The appropriate case for using <literal>BEFORE:</literal> is when the other script does not care about ours, but our script can do its task better if run before the other one. A typical real-life example is the network interfaces vs. the firewall: While the interfaces do not depend on the firewall in doing their job, the system security will benefit from the firewall being ready before there is any network traffic.
Besides conditions corresponding to a single service each, there are meta-conditions and their <quote>placeholder</quote> scripts used to ensure that certain groups of operations are performed before others. These are denoted by <filename><replaceable>UPPERCASE</replaceable></filename> names. Their list and purposes can be found in <citerefentry><refentrytitle>rc</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
Keep in mind that putting a service name in the <literal>REQUIRE:</literal> line does not guarantee that the service will actually be running by the time our script starts. The required service may fail to start or just be disabled in <citerefentry><refentrytitle>rc.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Obviously, <citerefentry><refentrytitle>rcorder</refentrytitle><manvolnum>8</manvolnum></citerefentry> cannot track such details, and <citerefentry><refentrytitle>rc</refentrytitle><manvolnum>8</manvolnum></citerefentry> will not do that either. Consequently, the application started by our script should be able to cope with any required services being unavailable. In certain cases, we can help it as discussed <link linkend="forcedep">below.</link>
<anchor xml:id="keywords"/>As we remember from the above text, <citerefentry><refentrytitle>rcorder</refentrytitle><manvolnum>8</manvolnum></citerefentry> keywords can be used to select or leave out some scripts. Namely any <citerefentry><refentrytitle>rcorder</refentrytitle><manvolnum>8</manvolnum></citerefentry> consumer can specify through <option>-k</option> and <option>-s</option> options which keywords are on the <quote>keep list</quote> and <quote>skip list</quote>, respectively. From all the files to be dependency sorted, <citerefentry><refentrytitle>rcorder</refentrytitle><manvolnum>8</manvolnum></citerefentry> will pick only those having a keyword from the keep list (unless empty) and not having a keyword from the skip list.
In FreeBSD, <citerefentry><refentrytitle>rcorder</refentrytitle><manvolnum>8</manvolnum></citerefentry> is used by <filename>/etc/rc</filename> and <filename>/etc/rc.shutdown</filename>. These two scripts define the standard list of FreeBSD <filename>rc.d</filename> keywords and their meanings as follows:

Loading…

No matching activity found.

Browse all component changes

Things to check

Long untranslated

The string was not translated for a long time

Reset

Unpluralised

The string is used as plural, but not using plural forms

Reset

Glossary

English English
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: callout/para
Labels
No labels currently set.
Flags
read-only
Source string location
article.translate.xml:1043
Source string age
9 months ago
Translation file
, string 122