diff options
Diffstat (limited to 'static/freebsd/man8')
| -rw-r--r-- | static/freebsd/man8/beinstall.8 3.html | 107 | ||||
| -rw-r--r-- | static/freebsd/man8/crash.8 3.html | 125 | ||||
| -rw-r--r-- | static/freebsd/man8/debug.sh.8 3.html | 150 | ||||
| -rw-r--r-- | static/freebsd/man8/diskless.8 3.html | 290 | ||||
| -rw-r--r-- | static/freebsd/man8/intro.8 4.html | 52 | ||||
| -rw-r--r-- | static/freebsd/man8/nanobsd.8 3.html | 278 | ||||
| -rw-r--r-- | static/freebsd/man8/rc.8 3.html | 472 | ||||
| -rw-r--r-- | static/freebsd/man8/rc.subr.8 3.html | 806 | ||||
| -rw-r--r-- | static/freebsd/man8/rescue.8 3.html | 112 | ||||
| -rw-r--r-- | static/freebsd/man8/uefi.8 3.html | 132 | ||||
| -rw-r--r-- | static/freebsd/man8/yp.8 3.html | 289 |
11 files changed, 0 insertions, 2813 deletions
diff --git a/static/freebsd/man8/beinstall.8 3.html b/static/freebsd/man8/beinstall.8 3.html deleted file mode 100644 index 701bc380..00000000 --- a/static/freebsd/man8/beinstall.8 3.html +++ /dev/null @@ -1,107 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">BEINSTALL.SH(8)</td> - <td class="head-vol">System Manager's Manual</td> - <td class="head-rtitle">BEINSTALL.SH(8)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">beinstall.sh</code> — - <span class="Nd">install a boot environment using the current FreeBSD source - tree</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> -<table class="Nm"> - <tr> - <td><code class="Nm">beinstall.sh</code></td> - <td>[<var class="Ar">options</var> <var class="Ar">...</var>]</td> - </tr> -</table> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp"><code class="Nm">beinstall.sh</code> installs a boot environment - using the current <span class="Ux">FreeBSD</span> source tree. - <code class="Nm">beinstall.sh</code> also automatically performs - <span class="Pa">/etc</span> updates (using <a class="Xr">etcupdate(8)</a>) - and package updates using <a class="Xr">pkg-upgrade(8)</a> automatically in - the new boot environment sandbox.</p> -<p class="Pp">Upon successful completion, the system will be ready to boot into - the new boot environment. Upon failure, the target boot environment will be - destroyed. In all cases, the running system is left untouched and a reboot - into a partially updated system (due to install or hardware failure) cannot - happen. Additionally, the full installation process requires only one reboot - as it is performed in a new boot environment.</p> -<p class="Pp"><code class="Nm">beinstall.sh</code> requires a fully built world - and kernel. It also requires <a class="Xr">pkg(8)</a>, which is not present - in the base system and has to be installed manually.</p> -<p class="Pp">The <var class="Ar">options</var> provided to - <code class="Nm">beinstall.sh</code> are world and kernel flags like - <code class="Ev">KERNCONF</code> as described in - <a class="Xr">build(7)</a>.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="ENVIRONMENT"><a class="permalink" href="#ENVIRONMENT">ENVIRONMENT</a></h1> -<p class="Pp">User modifiable variables. Set these in the environment if - desired:</p> -<dl class="Bl-tag"> - <dt id="BE_UTILITY"><a class="permalink" href="#BE_UTILITY"><code class="Ev">BE_UTILITY</code></a> - (default: “<code class="Li">bectl</code>”)</dt> - <dd>Utility to manage ZFS boot environments. This can be either - <a class="Xr">bectl(8)</a> from the base system or - <a class="Xr">beadm(1)</a> from ports (sysutils/beadm).</dd> - <dt id="CONFIG_UPDATER"><a class="permalink" href="#CONFIG_UPDATER"><code class="Ev">CONFIG_UPDATER</code></a> - (default: “<code class="Li">etcupdate</code>”)</dt> - <dd>Config updater: <a class="Xr">etcupdate(8)</a> is supported. Set to an - empty string to skip.</dd> - <dt id="ETCUPDATE_FLAGS"><a class="permalink" href="#ETCUPDATE_FLAGS"><code class="Ev">ETCUPDATE_FLAGS</code></a> - (default: “<code class="Li">-F</code>”)</dt> - <dd>Flags for <a class="Xr">etcupdate(8)</a> if used.</dd> - <dt id="NO_PKG_UPGRADE"><a class="permalink" href="#NO_PKG_UPGRADE"><code class="Ev">NO_PKG_UPGRADE</code></a> - (default: “<code class="Li"></code>”)</dt> - <dd>If not empty, “<code class="Li">pkg upgrade</code>” will be - skipped.</dd> -</dl> -</section> -<section class="Sh"> -<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1> -<dl class="Bl-tag"> - <dt id="src/"><a class="permalink" href="#src/"><b class="Sy">src/</b></a><span class="Pa">tools/build/beinstall.sh</span></dt> - <dd>Place where <code class="Nm">beinstall.sh</code> lives in the src - tree.</dd> -</dl> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">build(7)</a>, <a class="Xr">development(7)</a>, - <a class="Xr">bectl(8)</a>, <a class="Xr">etcupdate(8)</a>, - <a class="Xr">pkg(8)</a></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> -<p class="Pp"><code class="Nm">beinstall.sh</code> is inspired by and similar in - function to Solaris/illumos-style upgrades.</p> -<p class="Pp">The <code class="Nm">beinstall.sh</code> manual page first - appeared in <span class="Ux">FreeBSD 12.0</span>.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1> -<p class="Pp">The <code class="Nm">beinstall.sh</code> script was implemented by - <span class="An">Will Andrews</span> - <<a class="Mt" href="mailto:will@FreeBSD.org">will@FreeBSD.org</a>>. - This manual page was written by - <br/> - <span class="An">Mateusz Piotrowski</span> - <<a class="Mt" href="mailto:0mp@FreeBSD.org">0mp@FreeBSD.org</a>>.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">October 30, 2020</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> diff --git a/static/freebsd/man8/crash.8 3.html b/static/freebsd/man8/crash.8 3.html deleted file mode 100644 index c1e0a796..00000000 --- a/static/freebsd/man8/crash.8 3.html +++ /dev/null @@ -1,125 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">CRASH(8)</td> - <td class="head-vol">System Manager's Manual</td> - <td class="head-rtitle">CRASH(8)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">crash</code> — <span class="Nd">FreeBSD - system failures</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">This section explains a bit about system crashes and (very - briefly) how to analyze crash dumps.</p> -<p class="Pp">When the system crashes voluntarily it prints a message of the - form</p> -<dl class="Bl-diag Bd-indent"> - <dt>panic: why i gave up the ghost</dt> - <dd></dd> -</dl> -<p class="Pp">on the console, and if dumps have been enabled (see - <a class="Xr">dumpon(8)</a>), takes a dump on a mass storage peripheral, and - then invokes an automatic reboot procedure as described in - <a class="Xr">reboot(8)</a>. Unless some unexpected inconsistency is - encountered in the state of the file systems due to hardware or software - failure, the system will then resume multi-user operations.</p> -<p class="Pp">The system has a large number of internal consistency checks; if - one of these fails, then it will panic with a very short message indicating - which one failed. In many instances, this will be the name of the routine - which detected the error, or a two-word description of the inconsistency. A - full understanding of most panic messages requires perusal of the source - code for the system.</p> -<p class="Pp">The most common cause of system failures is hardware failure, - which can reflect itself in different ways. Here are the messages which are - most likely, with some hints as to causes. Left unstated in all cases is the - possibility that hardware or software error produced the message in some - unexpected way.</p> -<p class="Pp"></p> -<dl class="Bl-diag Bl-compact"> - <dt>Mounting from <device> failed with error <err></dt> - <dd>The system was unable to mount the configured root filesystem. Either the - root filesystem has been corrupted, or the system is attempting to use the - wrong device as root filesystem. - <p class="Pp" id="mountroot_">This is not a panic message; rather it is - followed by an interactive - <a class="permalink" href="#mountroot_"><b class="Sy">mountroot></b></a> - prompt where the operator can list detected devices and filesystems, and - select an alternative root filesystem to mount. Alternatively, the - system can be booted from recovery media to repair the situation. The - system install media provides a live environment which is suitable for - this task.</p> - <p class="Pp"></p> - </dd> - <dt>init: not found</dt> - <dd>This is not a panic message, as reboots are likely to be futile. Late in - the bootstrap procedure, the system was unable to locate and execute the - initialization process, <a class="Xr">init(8)</a>. The root file system is - incorrect or has been corrupted, or the mode or type of - <span class="Pa">/sbin/init</span> forbids execution or is totally - missing. - <p class="Pp"></p> - </dd> - <dt>ffs_realloccg: bad optim</dt> - <dd></dd> - <dt>ffs_valloc: dup alloc</dt> - <dd></dd> - <dt>ffs_alloccgblk: cyl groups corrupted</dt> - <dd></dd> - <dt>ffs_alloccg: map corrupted</dt> - <dd></dd> - <dt>blkfree: freeing free block</dt> - <dd></dd> - <dt>blkfree: freeing free frag</dt> - <dd></dd> - <dt>ifree: freeing free inode</dt> - <dd>These panic messages are among those that may be produced when file system - inconsistencies are detected. The problem generally results from a failure - to repair damaged file systems after a crash, hardware failures, or other - condition that should not normally occur. A file system check will - normally correct the problem. - <p class="Pp"></p> - </dd> - <dt>init died (signal #, exit #)</dt> - <dd>The system initialization process has exited with the specified signal - number and exit code. This is bad news, as no new users will then be able - to log in. Rebooting is the only fix, so the system just does it right - away.</dd> -</dl> -<p class="Pp">That completes the list of panic types you are likely to see.</p> -<p class="Pp">If the system has been configured to take crash dumps (see - <a class="Xr">dumpon(8)</a>), then when it crashes it will write (or at - least attempt to write) an image of memory into the back end of the dump - device, usually the same as the primary swap area. After the system is - rebooted, the program <a class="Xr">savecore(8)</a> runs and preserves a - copy of this core image and the current system in a specified directory for - later perusal. See <a class="Xr">savecore(8)</a> for details.</p> -<p class="Pp">To analyze a dump you should begin by running - <a class="Xr">kgdb(1)</a> (<span class="Pa">ports/devel/gdb</span>) on the - system load image and core dump. If the core image is the result of a panic, - the panic message is printed. For more details consult the chapter on kernel - debugging in the <i class="RsB">FreeBSD Developers' Handbook</i> - (<span class="Pa">https://www.freebsd.org/doc/en/books/developers-handbook/</span>).</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">kgdb(1)</a> - (<span class="Pa">ports/devel/gdb</span>), <a class="Xr">dumpon(8)</a>, - <a class="Xr">reboot(8)</a>, <a class="Xr">savecore(8)</a></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> -<p class="Pp">The <code class="Nm">crash</code> manual page first appeared in - <span class="Ux">FreeBSD 2.2</span>.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">July 25, 2025</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> diff --git a/static/freebsd/man8/debug.sh.8 3.html b/static/freebsd/man8/debug.sh.8 3.html deleted file mode 100644 index e4157c18..00000000 --- a/static/freebsd/man8/debug.sh.8 3.html +++ /dev/null @@ -1,150 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">DEBUG.SH(8)</td> - <td class="head-vol">System Manager's Manual</td> - <td class="head-rtitle">DEBUG.SH(8)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">debug.sh</code> — - <span class="Nd">selectively debug scripts</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> -<ul class="Bl-item Bl-compact"> - <li id="$_DEBUG_SH"><a class="permalink" href="#$_DEBUG_SH"><code class="Ic">$_DEBUG_SH - .</code></a> <span class="Pa">debug.sh</span> - <p class="Pp"></p> - </li> - <li id="DebugOn"><a class="permalink" href="#DebugOn"><code class="Ic">DebugOn</code></a> - [<code class="Fl">-eo</code>] <var class="Ar">tag ...</var></li> - <li id="DebugOff"><a class="permalink" href="#DebugOff"><code class="Ic">DebugOff</code></a> - [<code class="Fl">-eo</code>] - [<code class="Cm">rc=</code><var class="Ar">rc</var>] <var class="Ar">tag - ...</var></li> - <li id="Debugging"><a class="permalink" href="#Debugging"><code class="Ic">Debugging</code></a></li> - <li id="DebugAdd"><a class="permalink" href="#DebugAdd"><code class="Ic">DebugAdd</code></a> - <var class="Ar">tag</var></li> - <li id="DebugEcho"><a class="permalink" href="#DebugEcho"><code class="Ic">DebugEcho</code></a> - [<var class="Ar">message</var>]</li> - <li id="DebugLog"><a class="permalink" href="#DebugLog"><code class="Ic">DebugLog</code></a> - [<var class="Ar">message</var>]</li> - <li id="DebugShell"><a class="permalink" href="#DebugShell"><code class="Ic">DebugShell</code></a> - <var class="Ar">tag ...</var></li> - <li id="DebugTrace"><a class="permalink" href="#DebugTrace"><code class="Ic">DebugTrace</code></a> - <var class="Ar">message</var></li> - <li id="Debug"><a class="permalink" href="#Debug"><code class="Ic">Debug</code></a> - <var class="Ar">tag ...</var></li> -</ul> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp"><code class="Nm">debug.sh</code> provides the following functions - to facilitate flexible run-time tracing of complicated shell scripts.</p> -<dl class="Bl-tag"> - <dt id="DebugOn~2"><a class="permalink" href="#DebugOn~2"><code class="Ic">DebugOn</code></a> - [<code class="Fl">-eo</code>] <var class="Ar">tag ...</var></dt> - <dd>turns tracing on if any <var class="Ar">tag</var> is found in - <var class="Va">DEBUG_SH</var> (a comma separated list of tags). - <p class="Pp">It turns tracing off if <var class="Ar">!tag</var> is found in - <var class="Va">DEBUG_SH</var>.</p> - <p class="Pp">It sets <var class="Va">DEBUG_ON</var> to the - <var class="Ar">tag</var> that caused tracing to be enabled, or - <var class="Va">DEBUG_OFF</var> if we matched - <var class="Ar">!tag</var>.</p> - <p class="Pp">If <code class="Fl">-e</code> option is present, returns 1 if - no <var class="Ar">tag</var> matched.</p> - <p class="Pp">If <code class="Fl">-o</code> option is present, tracing is - turned off unless there was a matched <var class="Ar">tag</var>, useful - for functions too noisy to tace.</p> - </dd> - <dt id="DebugOff~2"><a class="permalink" href="#DebugOff~2"><code class="Ic">DebugOff</code></a> - [<code class="Fl">-eo</code>] - [<code class="Cm">rc=</code><var class="Ar">rc</var>] <var class="Ar">tag - ...</var></dt> - <dd>turns tracing on if any <var class="Ar">tag</var> matches - <var class="Va">DEBUG_OFF</var> or off if any <var class="Ar">tag</var> - matches <var class="Va">DEBUG_ON</var>. This allows nested functions to - not interfere with each other. - <p class="Pp" id="DebugOn~3">The flags <code class="Fl">-e</code> and - <code class="Fl">-o</code> are ignored, they just allow for symmetry - with calls to - <a class="permalink" href="#DebugOn~3"><code class="Fn">DebugOn</code></a>().</p> - <p class="Pp" id="DebugOff~3">The optional <var class="Ar">rc</var> value - will be returned rather than the default of 0. Thus if - <a class="permalink" href="#DebugOff~3"><code class="Fn">DebugOff</code></a>() - is the last operation in a function, <var class="Ar">rc</var> will be - the return code of the function.</p> - </dd> - <dt id="Debugging~2"><a class="permalink" href="#Debugging~2"><code class="Ic">Debugging</code></a></dt> - <dd>returns true if tracing is enabled. It is useful for bounding complex - debug actions, rather than using lots of <code class="Ic">$DEBUG_DO</code> - lines.</dd> - <dt id="DebugAdd~2"><a class="permalink" href="#DebugAdd~2"><code class="Ic">DebugAdd</code></a> - <var class="Ar">tag</var></dt> - <dd>Add <var class="Ar">tag</var> to <var class="Va">DEBUG_SH</var> to - influence later output, possibly in a child process.</dd> - <dt id="DebugEcho~2"><a class="permalink" href="#DebugEcho~2"><code class="Ic">DebugEcho</code></a></dt> - <dd>is just shorthand for: - <div class="Bd Pp Bd-indent Li"> - <pre>$DEBUG_DO echo "$@"</pre> - </div> - </dd> - <dt id="DebugLog~2"><a class="permalink" href="#DebugLog~2"><code class="Ic">DebugLog</code></a> - [<var class="Ar">message</var>]</dt> - <dd>If debugging is enabled, output <var class="Ar">message</var> prefixed - with a time-stamp.</dd> - <dt id="DebugShell~2"><a class="permalink" href="#DebugShell~2"><code class="Ic">DebugShell</code></a> - <var class="Ar">tag ...</var></dt> - <dd>runs an interactive shell if any <var class="Ar">tag</var> is found in - <var class="Va">DEBUG_INTERACTIVE</var>, and there is a tty available. The - shell used is defined by <var class="Va">DEBUG_SHELL</var> or - <var class="Va">SHELL</var> and defaults to - <span class="Pa">/bin/sh</span>.</dd> - <dt id="DebugTrace~2"><a class="permalink" href="#DebugTrace~2"><code class="Ic">DebugTrace</code></a> - <var class="Ar">message</var></dt> - <dd>Debug output can be very noisy, and it can be tricky to align with the - script. This function outputs a very noticeable banner indicating the - value of <var class="Va">DEBUG_ON</var>, and <var class="Ar">message</var> - is passed to <code class="Fn">DebugLog</code>(), finally the banner is - repeated.</dd> - <dt id="Debug~2"><a class="permalink" href="#Debug~2"><code class="Ic">Debug</code></a> - <var class="Ar">tag ...</var></dt> - <dd>For backwards compatibility, calls <code class="Fn">DebugOn</code>() and - if that does not turn tracing on, it calls - <code class="Fn">DebugOff</code>() to turn it off.</dd> -</dl> -<p class="Pp" id="Debug~3">The variables <var class="Va">DEBUG_SKIP</var> and - <var class="Va">DEBUG_DO</var> are set so as to enable/disable code that - should be skipped/run when debugging is turned on. - <var class="Va">DEBUGGING</var> is the same as - <var class="Va">DEBUG_SKIP</var> for backwards compatibility and is only set - by - <a class="permalink" href="#Debug~3"><code class="Fn">Debug</code></a>().</p> -<p class="Pp">The use of <code class="Ic">$_DEBUG_SH</code> is to prevent - multiple inclusion, though it does no harm in this case.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1> -<p class="Pp">Does not work with some versions of <a class="Xr">ksh(1)</a>. If a - function turns tracing on, ksh turns it off when the function returns - - useless.</p> -<p class="Pp">PD ksh works ok ;-)</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="AUTHOR"><a class="permalink" href="#AUTHOR">AUTHOR</a></h1> -<p class="Pp"><code class="Nm">debug.sh</code> was written by - <span class="An">Simon J Gerraty</span> - <<a class="Mt" href="mailto:sjg@crufty.net">sjg@crufty.net</a>>.</p> -<p class="Pp"></p> -<p class="Pp"></p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">October 22, 2024</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> diff --git a/static/freebsd/man8/diskless.8 3.html b/static/freebsd/man8/diskless.8 3.html deleted file mode 100644 index 9709944a..00000000 --- a/static/freebsd/man8/diskless.8 3.html +++ /dev/null @@ -1,290 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">DISKLESS(8)</td> - <td class="head-vol">System Manager's Manual</td> - <td class="head-rtitle">DISKLESS(8)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">diskless</code> — <span class="Nd">booting - a system over the network with PXE</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">The ability to boot a machine over the network is useful for - <a class="permalink" href="#diskless"><i class="Em" id="diskless">diskless</i></a> - or - <a class="permalink" href="#dataless"><i class="Em" id="dataless">dataless</i></a> - machines, or as a temporary measure while repairing or re-installing file - systems on a local disk. This file provides a general description of the - interactions between a client and its server when a client is booting over - the network.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="OPERATION"><a class="permalink" href="#OPERATION">OPERATION</a></h1> -<p class="Pp">When booting a system over the network, there are three phases of - interaction between client and server:</p> -<ol class="Bl-enum"> - <li>The stage-1 bootstrap, typically PXE built into your Ethernet card, loads - a second-stage boot program.</li> - <li>The second-stage boot program, typically <a class="Xr">pxeboot(8)</a>, - loads modules and the kernel, and boots the kernel.</li> - <li>The kernel NFS mounts the root directory and continues from there.</li> -</ol> -<p class="Pp">Each of these phases are described in further detail below.</p> -<p class="Pp">First, the stage-1 bootstrap loads the stage-2 boot program over - the network. The stage-1 bootstrap typically uses BOOTP or DHCP to obtain - the filename to load, then uses TFTP to load the file. This file is - typically called <span class="Pa">pxeboot</span>, and should be copied from - <span class="Pa">/boot/pxeboot</span> into the TFTP directory on the server, - which is typically <span class="Pa">/tftpdir</span>.</p> -<p class="Pp">The stage-2 boot program then loads additional modules and the - kernel. These files may not exist on the DHCP or BOOTP server. You can use - the <code class="Ic">next-server</code> option available in DHCP - configurations to specify the server holding the second stage boot files and - kernel. The stage-2 program uses NFS or TFTP to obtain these files. By - default, NFS is used. If you are using <a class="Xr">pxeboot(8)</a>, you can - install a version that uses TFTP by setting - <code class="Li">LOADER_TFTP_SUPPORT=YES</code> in your - <a class="Xr">make.conf(5)</a>, then recompiling and reinstalling - <a class="Xr">pxeboot(8)</a> via the command listed below. It is often - necessary to use TFTP here so you can place a custom kernel in - <span class="Pa">/tftpdir/</span>. If you use NFS and do not have a custom - root file system for the <code class="Nm">diskless</code> client, the - stage-2 boot will load your server's kernel as the kernel for the - <code class="Nm">diskless</code> machine, which may not be what you want to - have happen.</p> -<div class="Bd Pp Bd-indent Li"> -<pre>cd /usr/src/stand -make clean; make; make install -cp /boot/pxeboot /tftpdir/</pre> -</div> -<p class="Pp">In phase 3, the kernel acquires IP networking configuration in one - of two ways, and then proceeds to mount the root file system and start - operation. If the phase 2 loader supports passing network configuration to - the kernel using the kernel environment, then the kernel will configure the - network interface using that information. Otherwise, it must use DHCP or - BOOTP to acquire configuration information. The boot scripts recognize a - <code class="Nm">diskless</code> startup and perform the actions found in - <span class="Pa">/etc/rc.d/resolv</span>, - <span class="Pa">/etc/rc.d/tmp</span>, - <span class="Pa">/etc/rc.d/var</span>, and - <span class="Pa">/etc/rc.initdiskless</span>.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="CONFIGURATION"><a class="permalink" href="#CONFIGURATION">CONFIGURATION</a></h1> -<p class="Pp">In order to run a <code class="Nm">diskless</code> client, you - need the following:</p> -<ul class="Bl-bullet"> - <li>An NFS server which exports a root and <span class="Pa">/usr</span> - partitions with appropriate permissions. The - <code class="Nm">diskless</code> scripts work with read-only partitions, - as long as root is exported with <code class="Fl">-maproot</code>=0 so - that some system files can be accessed. As an example, - <span class="Pa">/etc/exports</span> can contain the following lines: - <div class="Bd Pp Bd-indent Li"> - <pre><ROOT> -ro -maproot=0 -alldirs <list of diskless clients> -/usr -ro -alldirs <list of diskless clients></pre> - </div> - <p class="Pp">where ⟨ROOT⟩ is the mount point on the server of - the root partition. The script - <span class="Pa">/usr/share/examples/diskless/clone_root</span> can be - used to create a shared read-only root partition, but in many cases you - may decide to export (again as read-only) the root directory used by the - server itself.</p> - </li> - <li>A BOOTP or DHCP server. <a class="Xr">bootpd(8)</a> can be enabled by - uncommenting the “<code class="Li">bootps</code>” line in - <span class="Pa">/etc/inetd.conf</span>. A sample - <span class="Pa">/etc/bootptab</span> can be the following: - <div class="Bd Pp Bd-indent Li"> - <pre> .default:\ - hn:ht=1:vm=rfc1048:\ - :sm=255.255.255.0:\ - :sa=<SERVER>:\ - :gw=<GATEWAY>:\ - :rp="<SERVER>:<ROOT>": - -<CLIENT>:ha=0123456789ab:tc=.default</pre> - </div> - <p class="Pp">where ⟨SERVER⟩, ⟨GATEWAY⟩ and - ⟨ROOT⟩ have the obvious meanings.</p> - </li> - <li>A properly initialized root partition. The script - <span class="Pa">/usr/share/examples/diskless/clone_root</span> can help - in creating it, using the server's root partition as a reference. If you - are just starting out, you should simply use the server's own root - directory, <span class="Pa">/</span>, and not try to clone it. - <p class="Pp">You often do not want to use the same - <span class="Pa">rc.conf</span> or <span class="Pa">rc.local</span> - files for the <code class="Nm">diskless</code> boot as you do on the - server. The <code class="Nm">diskless</code> boot scripts provide a - mechanism through which you can override various files in - <span class="Pa">/etc</span> (as well as other subdirectories of - root).</p> - <p class="Pp">One difference that you should pay particular attention to is - the value of <var class="Va">local_startup</var> in - <span class="Pa">/etc/defaults/rc.conf</span>. A typical value for a - <code class="Nm">diskless</code> boot is - <var class="Va">mountcritremote</var>, however your needs may be - different.</p> - <p class="Pp">The scripts provide four overriding directories situated in - <span class="Pa">/conf/base</span>, - <span class="Pa">/conf/default</span>, - <span class="Pa">/conf/<broadcast-ip></span>, and - <span class="Pa">/conf/<machine-ip></span>. You should always - create <span class="Pa">/conf/base/etc</span>, which will entirely - replace the server's <span class="Pa">/etc</span> on the - <code class="Nm">diskless</code> machine. You can clone the server's - <span class="Pa">/etc</span> here or you can create a special file which - tells the <code class="Nm">diskless</code> boot scripts to remount the - server's <span class="Pa">/etc</span> onto - <span class="Pa">/conf/base/etc</span>. You do this by creating the file - <span class="Pa">/conf/base/etc/diskless_remount</span> containing the - mount point to use as a basis of the <code class="Nm">diskless</code> - machine's <span class="Pa">/etc</span>. For example, the file might - contain:</p> - <p class="Pp"></p> - <div class="Bd Bd-indent"><code class="Li">10.0.0.1:/etc</code></div> - <p class="Pp">Alternatively, if the server contains several independent - roots, the file might contain:</p> - <p class="Pp"></p> - <div class="Bd - Bd-indent"><code class="Li">10.0.0.1:/usr/diskless/4.7-RELEASE/etc</code></div> - <p class="Pp">This would work, but if you copied - <span class="Pa">/usr/diskless/4.7-RELEASE</span> to - <span class="Pa">/usr/diskless/4.8-RELEASE</span> and upgraded the - installation, you would need to modify the - <span class="Pa">diskless_remount</span> files to reflect that move. To - avoid that, paths in <span class="Pa">diskless_remount</span> files - beginning with <span class="Pa">/</span> have the actual path of the - client's root prepended to them so the file could instead contain:</p> - <p class="Pp"></p> - <div class="Bd Bd-indent"><code class="Li">/etc</code></div> - <p class="Pp">The <code class="Nm">diskless</code> scripts create memory - file systems to hold the overridden directories. Only a 5MB partition is - created by default, which may not be sufficient for your purposes. To - override this, you can create the file - <span class="Pa">/conf/base/etc/md_size</span> containing the size, in - 512 byte sectors, of the memory disk to create for that directory.</p> - <p class="Pp">You then typically provide file-by-file overrides in the - <span class="Pa">/conf/default/etc</span> directory. At a minimum, you - must provide overrides for <span class="Pa">/etc/fstab</span>, - <span class="Pa">/etc/rc.conf</span>, and - <span class="Pa">/etc/rc.local</span> via - <span class="Pa">/conf/default/etc/fstab</span>, - <span class="Pa">/conf/default/etc/rc.conf</span>, and - <span class="Pa">/conf/default/etc/rc.local</span>.</p> - <p class="Pp">Overrides are hierarchical. You can supply network-specific - defaults in the - <span class="Pa">/conf/</span>⟨<var class="Ar">BROADCASTIP</var>⟩<span class="Pa">/etc</span> - directory, where ⟨<var class="Ar">BROADCASTIP</var>⟩ - represents the broadcast IP address of the - <code class="Nm">diskless</code> system as given to it via BOOTP. The - <span class="Pa">diskless_remount</span> and - <span class="Pa">md_size</span> features work in any of these - directories. The configuration feature works on directories other then - <span class="Pa">/etc</span>, you simply create the directory you wish - to replace or override in - <span class="Pa">/conf/{base,default,<broadcast>,<ip>}/*</span> - and work it in the same way that you work - <span class="Pa">/etc</span>.</p> - <p class="Pp">Since you normally clone the server's - <span class="Pa">/etc</span> using the - <span class="Pa">/conf/base/etc/diskless_remount</span>, you might wish - to remove unneeded files from the memory file system. For example, if - the server has a firewall but you do not, you might wish to remove - <span class="Pa">/etc/ipfw.conf</span>. You can do this by creating a - <span class="Pa">/conf/base/</span>⟨<var class="Ar">DIRECTORY</var>⟩<span class="Pa">.remove</span> - file. For example, <span class="Pa">/conf/base/etc.remove</span>, which - contains a list of relative paths that the boot scripts should remove - from the memory file systems.</p> - <p class="Pp">As a minimum, you normally need to have the following in - <span class="Pa">/conf/default/etc/fstab</span></p> - <div class="Bd Pp Bd-indent Li"> - <pre><SERVER>:<ROOT> / nfs ro 0 0 -<SERVER>:/usr /usr nfs ro 0 0</pre> - </div> - <p class="Pp">You also need to create a customized version of - <span class="Pa">/conf/default/etc/rc.conf</span> which should contain - the startup options for the <code class="Nm">diskless</code> client, and - <span class="Pa">/conf/default/etc/rc.local</span> which could be empty - but prevents the server's own <span class="Pa">/etc/rc.local</span> from - leaking onto the <code class="Nm">diskless</code> system.</p> - <p class="Pp">In <span class="Pa">rc.conf</span>, most likely you will not - need to set <var class="Va">hostname</var> and - <var class="Va">ifconfig_*</var> because these will be already set by - the startup code. Finally, it might be convenient to use a - <code class="Ic">case</code> statement using - <code class="Li">`hostname`</code> as the switch variable to do - machine-specific configuration in case a number of - <code class="Nm">diskless</code> clients share the same configuration - files.</p> - </li> - <li>The kernel for the <code class="Nm">diskless</code> clients, which will be - loaded using NFS or TFTP, must include support for the NFS client: - <p class="Pp"></p> - <div class="Bd Bd-indent"><code class="Cd">options NFSCL</code></div> - <div class="Bd Bd-indent"><code class="Cd">options NFS_ROOT</code></div> - <p class="Pp">If you are using a boot mechanism that does not pass network - configuration to the kernel using the kernel environment, you will also - need to include the following options:</p> - <p class="Pp"></p> - <div class="Bd Bd-indent"><code class="Cd">options BOOTP</code></div> - <div class="Bd Bd-indent"><code class="Cd">options - BOOTP_NFSROOT</code></div> - <div class="Bd Bd-indent"><code class="Cd">options BOOTP_COMPAT</code></div> - <p class="Pp" id="Note"><a class="permalink" href="#Note"><i class="Em">Note</i></a>: - the PXE environment does not require these options.</p> - <p class="Pp">The <code class="Nm">diskless</code> booting environment - relies on memory-backed file systems to support temporary local storage - in the event that the root file system is mounted read-only; as such, it - is necessary to add the following to the device section of the kernel - configuration:</p> - <p class="Pp"></p> - <div class="Bd Bd-indent"><code class="Cd">device md</code></div> - <p class="Pp">If you use the firewall, remember to default to - “open”, or your kernel will not be able to send/receive - the BOOTP packets.</p> - </li> -</ul> -</section> -<section class="Sh"> -<h1 class="Sh" id="SECURITY_ISSUES"><a class="permalink" href="#SECURITY_ISSUES">SECURITY - ISSUES</a></h1> -<p class="Pp">Be warned that using unencrypted NFS to mount root and user - partitions may expose information such as encryption keys.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">ethers(5)</a>, <a class="Xr">exports(5)</a>, - <a class="Xr">make.conf(5)</a>, <a class="Xr">bootpd(8)</a>, - <a class="Xr">mountd(8)</a>, <a class="Xr">nfsd(8)</a>, - <a class="Xr">pxeboot(8)</a>, <a class="Xr">reboot(8)</a>, - <a class="Xr">tftpd(8)</a></p> -<p class="Pp"><span class="Pa">ports/net/etherboot</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> -<p class="Pp">The <code class="Nm">diskless</code> environment first appeared in - <span class="Ux">FreeBSD 2.2.5</span>.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1> -<p class="Pp">This manpage is probably incomplete.</p> -<p class="Pp"><span class="Ux">FreeBSD</span> sometimes requires to write onto - the root partition, so the startup scripts mount MFS file systems on some - locations (e.g. <span class="Pa">/etc</span> and - <span class="Pa">/var</span>), while trying to preserve the original - content. The process might not handle all cases.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">August 11, 2024</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> diff --git a/static/freebsd/man8/intro.8 4.html b/static/freebsd/man8/intro.8 4.html deleted file mode 100644 index 9a8fa084..00000000 --- a/static/freebsd/man8/intro.8 4.html +++ /dev/null @@ -1,52 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">INTRO(8)</td> - <td class="head-vol">System Manager's Manual</td> - <td class="head-rtitle">INTRO(8)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">intro</code> — - <span class="Nd">introduction to system maintenance procedures and - commands</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">This section contains information related to system operation and - maintenance.</p> -<p class="Pp">It describes commands used to create new file systems - (<a class="Xr">newfs(8)</a>), verify the integrity of the file systems - (<a class="Xr">fsck(8)</a>), control disk usage - (<a class="Xr">edquota(8)</a>), maintain system backups - (<a class="Xr">dump(8)</a>), and recover files when disks die an untimely - death (<a class="Xr">restore(8)</a>). Network related services like - <a class="Xr">inetd(8)</a> are also described.</p> -<p class="Pp">All commands set an exit status. Its value may be tested to see if - the command completed normally. Unless otherwise noted (rare), the value 0 - signifies successful completion of the command, while a value >0 - indicates an error. Some commands attempt to describe the nature of the - failure by using error codes defined in <a class="Xr">sysexits(3)</a>, or - set the status to arbitrary values >0 (typically 1), but many such values - are not described in the manual.</p> -<p class="Pp">A number of pages in this section describe general system - management topics.</p> -<p class="Pp">For example, the <a class="Xr">boot(8)</a> manual page describes - the system bootstrapping procedures, and the <a class="Xr">diskless(8)</a> - manual page describes how to boot a system over a network. The - <a class="Xr">crash(8)</a> manual page should be consulted to understand how - to interpret system crash dumps.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> -<p class="Pp">The <code class="Nm">intro</code> section manual page appeared in - <span class="Ux">4.2BSD</span>.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">October 22, 2006</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> diff --git a/static/freebsd/man8/nanobsd.8 3.html b/static/freebsd/man8/nanobsd.8 3.html deleted file mode 100644 index d6ad1f23..00000000 --- a/static/freebsd/man8/nanobsd.8 3.html +++ /dev/null @@ -1,278 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">NANOBSD(8)</td> - <td class="head-vol">System Manager's Manual</td> - <td class="head-rtitle">NANOBSD(8)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">nanobsd.sh</code> — - <span class="Nd">create an embedded FreeBSD system image</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> -<table class="Nm"> - <tr> - <td><code class="Nm">nanobsd.sh</code></td> - <td>[<code class="Fl">-BbfhIiKknpqvWwX</code>] [<code class="Fl">-c</code> - <var class="Ar">config-file</var>]</td> - </tr> -</table> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">The <code class="Nm">nanobsd.sh</code> utility is a script which - produces a minimal implementation of <span class="Ux">FreeBSD</span> (called - <code class="Nm">NanoBSD</code>), which typically fits on a small media such - as an SD card, or other mass storage medium. It can be used to build - specialized install images, designed for easy installation and - maintenance.</p> -<p class="Pp">The following options are available:</p> -<div class="Bd-indent"> -<dl class="Bl-tag"> - <dt id="B"><a class="permalink" href="#B"><code class="Fl">-B</code></a></dt> - <dd>Skip the install stages (both for kernel and world).</dd> - <dt id="b"><a class="permalink" href="#b"><code class="Fl">-b</code></a></dt> - <dd>Skip the build stages (both for kernel and world).</dd> - <dt id="c"><a class="permalink" href="#c"><code class="Fl">-c</code></a> - <var class="Ar">config-file</var></dt> - <dd>Specify the configuration file to use.</dd> - <dt id="f"><a class="permalink" href="#f"><code class="Fl">-f</code></a></dt> - <dd>Skip the code slice extraction.</dd> - <dt id="h"><a class="permalink" href="#h"><code class="Fl">-h</code></a></dt> - <dd>Display usage information.</dd> - <dt id="I"><a class="permalink" href="#I"><code class="Fl">-I</code></a></dt> - <dd>Build the disk image from an existing build/install.</dd> - <dt id="i"><a class="permalink" href="#i"><code class="Fl">-i</code></a></dt> - <dd>Skip the disk image build stage.</dd> - <dt id="K"><a class="permalink" href="#K"><code class="Fl">-K</code></a></dt> - <dd>Skip the <code class="Cm">installkernel</code> stage of the build.</dd> - <dt id="k"><a class="permalink" href="#k"><code class="Fl">-k</code></a></dt> - <dd>Skip the <code class="Cm">buildkernel</code> stage of the build.</dd> - <dt id="n"><a class="permalink" href="#n"><code class="Fl">-n</code></a></dt> - <dd>Do not cleanup before each build stage. This suppresses the normal cleanup - work done before the <code class="Cm">buildworld</code> stage and adds - -DNO_CLEAN to the make command line used for each build stage (world and - kernel).</dd> - <dt id="p"><a class="permalink" href="#p"><code class="Fl">-p</code></a></dt> - <dd>Don't prepare the image. Skip running of the customization and early - customization scripts for incremental image refinement from world, kernel, - or packages.</dd> - <dt id="q"><a class="permalink" href="#q"><code class="Fl">-q</code></a></dt> - <dd>Make output more quiet.</dd> - <dt id="v"><a class="permalink" href="#v"><code class="Fl">-v</code></a></dt> - <dd>Make output more verbose.</dd> - <dt id="W"><a class="permalink" href="#W"><code class="Fl">-W</code></a></dt> - <dd>Skip the <code class="Cm">installworld</code> stage of the build.</dd> - <dt id="w"><a class="permalink" href="#w"><code class="Fl">-w</code></a></dt> - <dd>Skip the <code class="Cm">buildworld</code> stage of the build.</dd> - <dt id="X"><a class="permalink" href="#X"><code class="Fl">-X</code></a></dt> - <dd>Make <code class="Cm">native-xtools</code>.</dd> -</dl> -</div> -<p class="Pp">The features of <code class="Nm">NanoBSD</code> include:</p> -<p class="Pp"></p> -<ul class="Bl-bullet Bd-indent Bl-compact"> - <li>Ports and packages work as in <span class="Ux">FreeBSD</span>. Every - single application can be installed and used in a - <code class="Nm">NanoBSD</code> image, the same way as in - <span class="Ux">FreeBSD</span>.</li> - <li>No missing functionality. If it is possible to do something with - <span class="Ux">FreeBSD</span>, it is possible to do the same thing with - <code class="Nm">NanoBSD</code>, unless the specific feature or features - were explicitly removed from the <code class="Nm">NanoBSD</code> image - when it was created.</li> - <li>Everything is read-only at run-time. It is safe to pull the power-plug. - There is no necessity to run <a class="Xr">fsck(8)</a> after a - non-graceful shutdown of the system.</li> - <li>Easy to build and customize. Making use of just one shell script and one - configuration file it is possible to build reduced and customized images - satisfying any arbitrary set of requirements.</li> -</ul> -<section class="Ss"> -<h2 class="Ss" id="NanoBSD_Media_Layout"><a class="permalink" href="#NanoBSD_Media_Layout">NanoBSD - Media Layout</a></h2> -<p class="Pp">The mass storage medium is divided into three parts by default - (which are normally mounted read-only):</p> -<p class="Pp"></p> -<ul class="Bl-bullet Bd-indent Bl-compact"> - <li>Two image partitions: <code class="Li">code#1</code> and - <code class="Li">code#2</code>.</li> - <li>The configuration file partition, which can be mounted under the - <span class="Pa">/cfg</span> directory at run time.</li> -</ul> -<p class="Pp">The <span class="Pa">/etc</span> and <span class="Pa">/var</span> - directories are <a class="Xr">md(4)</a> (malloc backed) disks.</p> -<p class="Pp">The configuration file partition persists under the - <span class="Pa">/cfg</span> directory. It contains files for - <span class="Pa">/etc</span> directory and is briefly mounted read-only - right after the system boot, therefore it is required to copy modified files - from <span class="Pa">/etc</span> back to the <span class="Pa">/cfg</span> - directory if changes are expected to persist after the system restarts.</p> -</section> -</section> -<section class="Sh"> -<h1 class="Sh" id="BUILDING_NanoBSD"><a class="permalink" href="#BUILDING_NanoBSD">BUILDING - <code class="Nm">NanoBSD</code></a></h1> -<p class="Pp">A <code class="Nm">NanoBSD</code> image is built using a simple - <code class="Nm">nanobsd.sh</code> shell script, which can be found in the - <span class="Pa">src/tools/tools/nanobsd</span> directory. This script - creates a bootable image, which can be copied on the storage medium using - the <a class="Xr">dd(1)</a> utility.</p> -<p class="Pp">The necessary commands to build and install a - <code class="Nm">NanoBSD</code> image are:</p> -<div class="Bd Pp Bd-indent Li"> -<pre>cd /usr/src/tools/tools/nanobsd -sh nanobsd.sh -cd /usr/obj/nanobsd.full -dd if=_.disk.full of=/dev/da0 bs=64k</pre> -</div> -</section> -<section class="Sh"> -<h1 class="Sh" id="CUSTOMIZING_NanoBSD"><a class="permalink" href="#CUSTOMIZING_NanoBSD">CUSTOMIZING - <code class="Nm">NanoBSD</code></a></h1> -<p class="Pp">This is probably the most important and most interesting feature - of <code class="Nm">NanoBSD</code>. This is also where you will be spending - most of the time when developing with <code class="Nm">NanoBSD</code>.</p> -<p class="Pp">Customization is done in two ways:</p> -<p class="Pp"></p> -<ul class="Bl-bullet Bd-indent Bl-compact"> - <li>Configuration options.</li> - <li>Custom functions.</li> -</ul> -<p class="Pp">With configuration settings, it is possible to configure options - passed to both the <code class="Cm">buildworld</code> and - <code class="Cm">installworld</code> stages of the - <code class="Nm">NanoBSD</code> build process, as well as internal options - passed to the main build process of <code class="Nm">NanoBSD</code>. Through - these options it is possible to cut the system down, so it will fit on as - little as 64MB. You can use the configuration options to trim down the - system even more, until it will consist of just the kernel and two or three - files in the userland.</p> -<p class="Pp">The configuration file consists of configuration options, which - override the default values. The most important directives are:</p> -<div class="Bd-indent"> -<dl class="Bl-tag"> - <dt id="NANO_NAME"><var class="Va">NANO_NAME</var></dt> - <dd>Build name (used to construct the working directory names).</dd> - <dt id="NANO_SRC"><var class="Va">NANO_SRC</var></dt> - <dd>Path to the source tree used to build the image.</dd> - <dt id="NANO_KERNEL"><var class="Va">NANO_KERNEL</var></dt> - <dd>Name of the kernel configuration file used to build the kernel.</dd> - <dt id="NANO_ARCH"><var class="Va">NANO_ARCH</var></dt> - <dd>Machine processor architecture to build. Defaults to output of - <code class="Cm">uname -p</code>.</dd> - <dt id="NANO_BOOT0CFG"><var class="Va">NANO_BOOT0CFG</var></dt> - <dd>Controls the options passed to <a class="Xr">boot0cfg(8)</a>; these - dictate <code class="Nm">boot0</code>'s behaviour.</dd> - <dt id="NANO_BOOTLOADER"><var class="Va">NANO_BOOTLOADER</var></dt> - <dd>The <code class="Nm">boot0</code> loader to use relative to the - <var class="Va">NANO_WORLDDIR</var> variable. This defaults to - <span class="Pa">boot/boot0sio</span> and should be overridden to - <span class="Pa">boot/boot0</span> to provide a VGA console.</dd> - <dt id="CONF_BUILD"><var class="Va">CONF_BUILD</var></dt> - <dd>Options passed to the <code class="Cm">buildworld</code> stage of the - build.</dd> - <dt id="CONF_INSTALL"><var class="Va">CONF_INSTALL</var></dt> - <dd>Options passed to the <code class="Cm">installworld</code> stage of the - build.</dd> - <dt id="CONF_WORLD"><var class="Va">CONF_WORLD</var></dt> - <dd>Options passed to both the <code class="Cm">buildworld</code> and - <code class="Cm">installworld</code> stages of the build.</dd> - <dt id="FlashDevice"><var class="Va">FlashDevice</var></dt> - <dd>Defines the type of media to use. Check the - <span class="Pa">FlashDevice.sub</span> file for more details.</dd> -</dl> -</div> -<p class="Pp">For more configuration options, please check the - <code class="Nm">nanobsd.sh</code> script.</p> -<p class="Pp">To build <code class="Nm">NanoBSD</code> image using the - <span class="Pa">nanobsd.conf</span> configuration file, use the following - command:</p> -<div class="Bd Pp Bd-indent Li"> -<pre>sh nanobsd.sh -c nanobsd.conf</pre> -</div> -<p class="Pp">It is possible to fine-tune <code class="Nm">NanoBSD</code> using - shell functions in the configuration file. The following example illustrates - the basic model of custom functions:</p> -<div class="Bd Pp Bd-indent Li"> -<pre>cust_foo () ( - echo "bar=topless" > \ - ${NANO_WORLDDIR}/etc/foo -) -customize_cmd cust_foo</pre> -</div> -<p class="Pp">There are a few pre-defined customization functions ready for - use:</p> -<div class="Bd-indent"> -<dl class="Bl-tag"> - <dt id="cust_comconsole"><a class="permalink" href="#cust_comconsole"><code class="Cm">cust_comconsole</code></a></dt> - <dd>Disables <a class="Xr">getty(8)</a> on the virtual - <a class="Xr">syscons(4)</a> or <a class="Xr">vt(4)</a> terminals - (<span class="Pa">/dev/ttyv*</span>) and enables the use of the first - serial port as the system console.</dd> - <dt id="cust_allow_ssh_root"><a class="permalink" href="#cust_allow_ssh_root"><code class="Cm">cust_allow_ssh_root</code></a></dt> - <dd>Allow root to log in via <a class="Xr">sshd(8)</a>.</dd> - <dt id="cust_install_files"><a class="permalink" href="#cust_install_files"><code class="Cm">cust_install_files</code></a></dt> - <dd>Installs files from the <span class="Pa">nanobsd/Files</span> directory, - which contains some useful scripts for system administration.</dd> -</dl> -</div> -</section> -<section class="Sh"> -<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1> -<dl class="Bl-tag Bl-compact"> - <dt><span class="Pa">src/tools/tools/nanobsd</span></dt> - <dd>Base directory of the <code class="Nm">NanoBSD</code> build script.</dd> -</dl> -</section> -<section class="Sh"> -<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1> -<p class="Pp">Making persistent changes to - <span class="Pa">/etc/resolv.conf</span>:</p> -<div class="Bd Pp Bd-indent Li"> -<pre>vi /etc/resolv.conf -... -mount /cfg -cp /etc/resolv.conf /cfg -umount /cfg</pre> -</div> -<p class="Pp">A more useful example of a customization function is the - following, which changes the default size of the - <span class="Pa">/etc</span> directory from 5MB to 30MB:</p> -<div class="Bd Pp Bd-indent Li"> -<pre>cust_etc_size () ( - cd ${NANO_WORLDDIR}/conf - echo 30000 > default/etc/md_size -) -customize_cmd cust_etc_size</pre> -</div> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">make.conf(5)</a>, <a class="Xr">boot(8)</a>, - <a class="Xr">boot0cfg(8)</a></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> -<p class="Pp">The <code class="Nm">nanobsd.sh</code> utility first appeared in - <span class="Ux">FreeBSD 6.0</span>.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1> -<p class="Pp"><code class="Nm">NanoBSD</code> was developed by - <span class="An">Poul-Henning Kamp</span> - <<a class="Mt" href="mailto:phk@FreeBSD.org">phk@FreeBSD.org</a>>. - This manual page was written by <span class="An">Daniel Gerzo</span> - <<a class="Mt" href="mailto:danger@FreeBSD.org">danger@FreeBSD.org</a>>.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">September 9, 2025</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> diff --git a/static/freebsd/man8/rc.8 3.html b/static/freebsd/man8/rc.8 3.html deleted file mode 100644 index a5052e3d..00000000 --- a/static/freebsd/man8/rc.8 3.html +++ /dev/null @@ -1,472 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">RC(8)</td> - <td class="head-vol">System Manager's Manual</td> - <td class="head-rtitle">RC(8)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">rc</code> — <span class="Nd">command - scripts for auto-reboot and daemon startup</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> -<table class="Nm"> - <tr> - <td><code class="Nm">rc</code></td> - <td></td> - </tr> -</table> -<br/> -<table class="Nm"> - <tr> - <td><code class="Nm">rc.conf</code></td> - <td></td> - </tr> -</table> -<br/> -<table class="Nm"> - <tr> - <td><code class="Nm">rc.conf.local</code></td> - <td></td> - </tr> -</table> -<br/> -<table class="Nm"> - <tr> - <td><code class="Nm">rc.d/</code></td> - <td></td> - </tr> -</table> -<br/> -<table class="Nm"> - <tr> - <td><code class="Nm">rc.firewall</code></td> - <td></td> - </tr> -</table> -<br/> -<table class="Nm"> - <tr> - <td><code class="Nm">rc.local</code></td> - <td></td> - </tr> -</table> -<br/> -<table class="Nm"> - <tr> - <td><code class="Nm">rc.resume</code></td> - <td></td> - </tr> -</table> -<br/> -<table class="Nm"> - <tr> - <td><code class="Nm">rc.shutdown</code></td> - <td></td> - </tr> -</table> -<br/> -<table class="Nm"> - <tr> - <td><code class="Nm">rc.subr</code></td> - <td></td> - </tr> -</table> -<br/> -<table class="Nm"> - <tr> - <td><code class="Nm">rc.suspend</code></td> - <td></td> - </tr> -</table> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">The <code class="Nm">rc</code> utility is the command script which - controls the automatic boot process after being called by - <a class="Xr">init(8)</a>. The <code class="Nm">rc.local</code> script - contains commands which are pertinent only to a specific site. Typically, - the <span class="Pa">/usr/local/etc/rc.d/</span> mechanism is used instead - of <code class="Nm">rc.local</code> these days but if you want to use - <code class="Nm">rc.local</code>, it is still supported. In this case, it - should source <span class="Pa">/etc/rc.conf</span> and contain additional - custom startup code for your system. The best way to handle - <code class="Nm">rc.local</code>, however, is to separate it out into - <code class="Nm">rc.d/</code> style scripts and place them under - <span class="Pa">/usr/local/etc/rc.d/</span>. The - <code class="Nm">rc.conf</code> file contains the global system - configuration information referenced by the startup scripts, while - <code class="Nm">rc.conf.local</code> contains the local system - configuration. See <a class="Xr">rc.conf(5)</a> for more information.</p> -<p class="Pp">The <code class="Nm">rc.d/</code> directories contain scripts - which will be automatically executed at boot time and shutdown time.</p> -<p class="Pp">The <a class="Xr">service(8)</a> command provides a convenient - interface to manage rc.d services.</p> -<p class="Pp">The <a class="Xr">sysrc(8)</a> command provides a scripting - interface to modify system config files.</p> -<section class="Ss"> -<h2 class="Ss" id="Operation_of_rc"><a class="permalink" href="#Operation_of_rc">Operation - of <code class="Nm">rc</code></a></h2> -<ol class="Bl-enum"> - <li>If autobooting, set - <var class="Va">autoboot</var>=<code class="Li">yes</code> and enable a - flag (<var class="Va">rc_fast</var>=<code class="Li">yes</code>), which - prevents the <code class="Nm">rc.d/</code> scripts from performing the - check for already running processes (thus speeding up the boot process). - This <var class="Va">rc_fast</var>=<code class="Li">yes</code> speedup - will not occur when <code class="Nm">rc</code> is started up after exiting - the single-user shell.</li> - <li>Determine whether the system is booting diskless, and if so run the - <span class="Pa">/etc/rc.initdiskless</span> script.</li> - <li>Source <span class="Pa">/etc/rc.subr</span> to load various - <a class="Xr">rc.subr(8)</a> shell functions to use.</li> - <li>Load the configuration files (see below for reloading).</li> - <li>Determine if booting in a jail, and add - “<code class="Li">nojail</code>” (no jails allowed) or - “<code class="Li">nojailvnet</code>” (only allow - vnet-enabled jails) to the list of KEYWORDS to skip in - <a class="Xr">rcorder(8)</a>.</li> - <li>If the file <var class="Va">${firstboot_sentinel}</var> does not exist, - add “<code class="Li">firstboot</code>” to the list of - KEYWORDS to skip in <a class="Xr">rcorder(8)</a>.</li> - <li>Invoke <a class="Xr">rcorder(8)</a> to order the files in - <span class="Pa">/etc/rc.d/</span> that do not have a - “<code class="Li">nostart</code>” KEYWORD (refer to - <a class="Xr">rcorder(8)</a>'s <code class="Fl">-s</code> flag).</li> - <li id="run_rc_scripts">Call - <a class="permalink" href="#run_rc_scripts"><code class="Fn">run_rc_scripts</code></a>() - with the list of scripts to be run. - <p class="Pp" id="run_rc_script">For each script that will call - <a class="permalink" href="#run_rc_script"><code class="Fn">run_rc_script</code></a>() - (both functions are from <a class="Xr">rc.subr(8)</a>), which sets - <var class="Va">$1</var> to - “<code class="Li">start</code>”, and sources the script in - a subshell. Stop processing when the script that is the value of the - <var class="Va">$early_late_divider</var> has been run.</p> - </li> - <li>Check again to see if the file <var class="Va">${firstboot_sentinel}</var> - exists (in case it is located on a newly mounted file system) and adjust - the list of KEYWORDs to skip appropriately.</li> - <li>Re-run <a class="Xr">rcorder(8)</a>, this time including the scripts in - the <var class="Va">$local_startup</var> directories. Call - <code class="Fn">run_rc_scripts</code>() again with the new list of - scripts. It will skip any that have already been run and execute the rest - as described above.</li> - <li>If the file <var class="Va">${firstboot_sentinel}</var> exists, delete it. - If the file <var class="Va">${firstboot_sentinel}-reboot</var> also exists - (because it was created by a script), then delete it and reboot.</li> -</ol> -</section> -<section class="Ss"> -<h2 class="Ss" id="Operation_of_rc.shutdown"><a class="permalink" href="#Operation_of_rc.shutdown">Operation - of <code class="Nm">rc.shutdown</code></a></h2> -<ol class="Bl-enum"> - <li>Set <var class="Va">rc_shutdown</var> to the value of the first argument - passed to <code class="Nm">rc.shutdown</code> or to - “<code class="Li">unspecified</code>” if no argument was - passed.</li> - <li>Source <span class="Pa">/etc/rc.subr</span> to load various - <a class="Xr">rc.subr(8)</a> shell functions to use.</li> - <li>Load the configuration files.</li> - <li>Invoke <a class="Xr">rcorder(8)</a> to order the files in - <span class="Pa">/etc/rc.d/</span> and the - <var class="Va">$local_startup</var> directories that have a - “<code class="Li">shutdown</code>” KEYWORD (refer to - <a class="Xr">rcorder(8)</a>'s <code class="Fl">-k</code> flag), reverse - that order, and assign the result to a variable.</li> - <li>Call each script in turn using <code class="Fn">run_rc_script</code>() - (from <a class="Xr">rc.subr(8)</a>), which sets <var class="Va">$1</var> - to “<code class="Li">faststop</code>”, and sources the - script in a subshell.</li> -</ol> -</section> -<section class="Ss"> -<h2 class="Ss" id="Contents_of_rc.d/"><a class="permalink" href="#Contents_of_rc.d/">Contents - of <code class="Nm">rc.d/</code></a></h2> -<p class="Pp"><code class="Nm">rc.d/</code> is located in - <span class="Pa">/etc/rc.d/</span>. The following file naming conventions - are currently used in <code class="Nm">rc.d/</code>:</p> -<div class="Bd-indent"> -<dl class="Bl-tag"> - <dt><span class="Pa">ALLUPPERCASE</span></dt> - <dd>Scripts that are “placeholders” to ensure that certain - operations are performed before others. In order of startup, these are: - <dl class="Bl-tag"> - <dt><span class="Pa">FILESYSTEMS</span></dt> - <dd>Ensure that root and other critical file systems are mounted. This is - the default <var class="Va">$early_late_divider</var>.</dd> - <dt><span class="Pa">NETWORKING</span></dt> - <dd>Ensure basic network services are running, including general network - configuration.</dd> - <dt><span class="Pa">SERVERS</span></dt> - <dd>Ensure basic services exist for services that start early (such as - <span class="Pa">nisdomain</span>), because they are required by - <span class="Pa">DAEMON</span> below.</dd> - <dt><span class="Pa">DAEMON</span></dt> - <dd>Check-point before all general purpose daemons such as - <span class="Pa">lpd</span> and <span class="Pa">ntpd</span>.</dd> - <dt><span class="Pa">LOGIN</span></dt> - <dd>Check-point before user login services (<span class="Pa">inetd</span> - and <span class="Pa">sshd</span>), as well as services which might run - commands as users (<span class="Pa">cron</span> and - <span class="Pa">sendmail</span>).</dd> - </dl> - </dd> - <dt id="stop_boot"><span class="Pa">bar</span></dt> - <dd>Scripts that are sourced in a subshell. The boot does not stop if such a - script terminates with a non-zero status, but a script can stop the boot - if necessary by invoking the - <a class="permalink" href="#stop_boot"><code class="Fn">stop_boot</code></a>() - function (from <a class="Xr">rc.subr(8)</a>).</dd> -</dl> -</div> -<p class="Pp">Each script should contain <a class="Xr">rcorder(8)</a> keywords, - especially an appropriate “<code class="Li">PROVIDE</code>” - entry, and if necessary “<code class="Li">REQUIRE</code>” and - “<code class="Li">BEFORE</code>” keywords.</p> -<p class="Pp" id="run_rc_command">Each script is expected to support at least - the following arguments, which are automatically supported if it uses the - <a class="permalink" href="#run_rc_command"><code class="Fn">run_rc_command</code></a>() - function:</p> -<div class="Bd-indent"> -<dl class="Bl-tag"> - <dt id="start"><a class="permalink" href="#start"><code class="Cm">start</code></a></dt> - <dd>Start the service. This should check that the service is to be started as - specified by <a class="Xr">rc.conf(5)</a>. Also checks if the service is - already running and refuses to start if it is. This latter check is not - performed by standard <span class="Ux">FreeBSD</span> scripts if the - system is starting directly to multi-user mode, to speed up the boot - process. If <code class="Cm">forcestart</code> is given, ignore the - <a class="Xr">rc.conf(5)</a> check and start anyway.</dd> - <dt id="stop"><a class="permalink" href="#stop"><code class="Cm">stop</code></a></dt> - <dd>If the service is to be started as specified by - <a class="Xr">rc.conf(5)</a>, stop the service. This should check that the - service is running and complain if it is not. If - <code class="Cm">forcestop</code> is given, ignore the - <a class="Xr">rc.conf(5)</a> check and attempt to stop.</dd> - <dt id="restart"><a class="permalink" href="#restart"><code class="Cm">restart</code></a></dt> - <dd>Perform a <code class="Cm">stop</code> then a - <code class="Cm">start</code>.</dd> - <dt id="status"><a class="permalink" href="#status"><code class="Cm">status</code></a></dt> - <dd>If the script starts a process (rather than performing a one-off - operation), show the status of the process. Otherwise it is not necessary - to support this argument. Defaults to displaying the process ID of the - program (if running).</dd> - <dt id="enable"><a class="permalink" href="#enable"><code class="Cm">enable</code></a></dt> - <dd>Enable the service in <a class="Xr">rc.conf(5)</a>.</dd> - <dt id="disable"><a class="permalink" href="#disable"><code class="Cm">disable</code></a></dt> - <dd>Disable the service in <a class="Xr">rc.conf(5)</a>.</dd> - <dt id="delete"><a class="permalink" href="#delete"><code class="Cm">delete</code></a></dt> - <dd>Remove the service from <a class="Xr">rc.conf(5)</a>. If - ‘<code class="Li"><code class="Li">service_delete_empty</code></code>’ - is set to “<code class="Li">YES</code>”, - <span class="Pa">/etc/rc.conf.d/$servicename</span> will be deleted if - empty after modification.</dd> - <dt id="describe"><a class="permalink" href="#describe"><code class="Cm">describe</code></a></dt> - <dd>Print a short description of what the script does.</dd> - <dt id="extracommands"><a class="permalink" href="#extracommands"><code class="Cm">extracommands</code></a></dt> - <dd>Print the script's non-standard commands.</dd> - <dt id="poll"><a class="permalink" href="#poll"><code class="Cm">poll</code></a></dt> - <dd>If the script starts a process (rather than performing a one-off - operation), wait for the command to exit. Otherwise it is not necessary to - support this argument.</dd> - <dt id="enabled"><a class="permalink" href="#enabled"><code class="Cm">enabled</code></a></dt> - <dd>Return 0 if the service is enabled and 1 if it is not. This command does - not print anything.</dd> - <dt id="rcvar"><a class="permalink" href="#rcvar"><code class="Cm">rcvar</code></a></dt> - <dd>Display which <a class="Xr">rc.conf(5)</a> variables are used to control - the startup of the service (if any).</dd> -</dl> -</div> -<p class="Pp">If a script must implement additional commands it can list them in - the <var class="Va">extra_commands</var> variable, and define their actions - in a variable constructed from the command name (see the - <a class="Sx" href="#EXAMPLES">EXAMPLES</a> section).</p> -<p class="Pp">The configuration files are normally read only once at the start - of a boot sequence; if a script needs to <code class="Cm">enable</code> or - <code class="Cm">disable</code> any other script that would run later in the - sequence, it must send a <code class="Dv">SIGALRM</code> to the rc process - (identified by <code class="Ev">$RC_PID</code>) to have it re-read the - files.</p> -<p class="Pp">The following key points apply to old-style scripts in - <span class="Pa">/usr/local/etc/rc.d/</span>:</p> -<ul class="Bl-bullet"> - <li>Scripts are only executed if their <a class="Xr">basename(1)</a> matches - the shell globbing pattern <span class="Pa">*.sh</span>, and they are - executable. Any other files or directories present within the directory - are silently ignored.</li> - <li>When a script is executed at boot time, it is passed the string - “<code class="Li">start</code>” as its first and only - argument. At shutdown time, it is passed the string - “<code class="Li">stop</code>” as its first and only - argument. All <code class="Nm">rc.d/</code> scripts are expected to handle - these arguments appropriately. If no action needs to be taken at a given - time (either boot time or shutdown time), the script should exit - successfully and without producing an error message.</li> - <li>The scripts within each directory are executed in lexicographical order. - If a specific order is required, numbers may be used as a prefix to the - existing filenames, so for example <span class="Pa">100.foo</span> would - be executed before <span class="Pa">200.bar</span>; without the numeric - prefixes the opposite would be true.</li> - <li id="without">The output from each script is traditionally a space - character, followed by the name of the software package being started or - shut down, - <a class="permalink" href="#without"><i class="Em">without</i></a> a - trailing newline character.</li> -</ul> -</section> -</section> -<section class="Sh"> -<h1 class="Sh" id="SCRIPTS_OF_INTEREST"><a class="permalink" href="#SCRIPTS_OF_INTEREST">SCRIPTS - OF INTEREST</a></h1> -<p class="Pp">When an automatic reboot is in progress, - <code class="Nm">rc</code> is invoked with the argument - <code class="Cm">autoboot</code>. One of the scripts run from - <span class="Pa">/etc/rc.d/</span> is - <span class="Pa">/etc/rc.d/fsck</span>. This script runs - <a class="Xr">fsck(8)</a> with option <code class="Fl">-p</code> and - <code class="Fl">-F</code> to “preen” all the disks of minor - inconsistencies resulting from the last system shutdown. If this fails, then - checks/repairs of serious inconsistencies caused by hardware or software - failure will be performed in the background at the end of the booting - process. If <code class="Cm">autoboot</code> is not set, when going from - single-user to multi-user mode for example, the script does not do - anything.</p> -<p class="Pp">The <span class="Pa">/etc/rc.d/serial</span> script is used to set - any special configurations for serial devices.</p> -<p class="Pp">The <code class="Nm">rc.firewall</code> script is used to - configure rules for the kernel based firewall service. It has several - possible options:</p> -<p class="Pp"></p> -<div class="Bd-indent"> -<dl class="Bl-tag Bl-compact"> - <dt id="open"><a class="permalink" href="#open"><code class="Cm">open</code></a></dt> - <dd>will allow anyone in</dd> - <dt id="client"><a class="permalink" href="#client"><code class="Cm">client</code></a></dt> - <dd>will try to protect just this machine</dd> - <dt id="simple"><a class="permalink" href="#simple"><code class="Cm">simple</code></a></dt> - <dd>will try to protect a whole network</dd> - <dt id="closed"><a class="permalink" href="#closed"><code class="Cm">closed</code></a></dt> - <dd>totally disables IP services except via <span class="Pa">lo0</span> - interface</dd> - <dt id="UNKNOWN"><a class="permalink" href="#UNKNOWN"><code class="Cm">UNKNOWN</code></a></dt> - <dd>disables the loading of firewall rules</dd> - <dt><var class="Ar">filename</var></dt> - <dd>will load the rules in the given filename (full path required).</dd> -</dl> -</div> -<p class="Pp">Most daemons, including network related daemons, have their own - script in <span class="Pa">/etc/rc.d/</span>, which can be used to start, - stop, and check the status of the service.</p> -<p class="Pp">Any architecture specific scripts, such as - <span class="Pa">/etc/rc.d/apm</span> for example, specifically check that - they are on that architecture before starting the daemon.</p> -<p class="Pp">Following tradition, all startup files reside in - <span class="Pa">/etc</span>.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1> -<dl class="Bl-tag Bl-compact"> - <dt><span class="Pa">/etc/rc</span></dt> - <dd style="width: auto;"> </dd> - <dt><span class="Pa">/etc/rc.conf</span></dt> - <dd style="width: auto;"> </dd> - <dt><span class="Pa">/etc/rc.conf.local</span></dt> - <dd style="width: auto;"> </dd> - <dt><span class="Pa">/etc/rc.d/</span></dt> - <dd style="width: auto;"> </dd> - <dt><span class="Pa">/etc/rc.firewall</span></dt> - <dd style="width: auto;"> </dd> - <dt><span class="Pa">/etc/rc.local</span></dt> - <dd style="width: auto;"> </dd> - <dt><span class="Pa">/etc/rc.shutdown</span></dt> - <dd style="width: auto;"> </dd> - <dt><span class="Pa">/etc/rc.subr</span></dt> - <dd style="width: auto;"> </dd> - <dt><span class="Pa">/var/run/dmesg.boot</span></dt> - <dd><a class="Xr">dmesg(8)</a> results soon after the - <code class="Nm">rc</code> process begins. Useful when - <a class="Xr">dmesg(8)</a> buffer in the kernel no longer has this - information.</dd> -</dl> -</section> -<section class="Sh"> -<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1> -<p class="Pp">The following is a minimal <code class="Nm">rc.d/</code> style - script. Most scripts require little more than the following.</p> -<div class="Bd Pp Bd-indent Li"> -<pre>#!/bin/sh -# - -# PROVIDE: foo -# REQUIRE: bar_service_required_to_precede_foo - -. /etc/rc.subr - -name="foo" -rcvar=foo_enable -command="/usr/local/bin/foo" - -load_rc_config $name -run_rc_command "$1"</pre> -</div> -<p class="Pp">Certain scripts may want to provide enhanced functionality. The - user may access this functionality through additional commands. The script - may list and define as many commands at it needs.</p> -<div class="Bd Pp Bd-indent Li"> -<pre>#!/bin/sh -# - -# PROVIDE: foo -# REQUIRE: bar_service_required_to_precede_foo -# BEFORE: baz_service_requiring_foo_to_precede_it - -. /etc/rc.subr - -name="foo" -rcvar=foo_enable -command="/usr/local/bin/foo" -extra_commands="nop hello" -hello_cmd="echo Hello World." -nop_cmd="do_nop" - -do_nop() -{ - echo "I do nothing." -} - -load_rc_config $name -run_rc_command "$1"</pre> -</div> -<p class="Pp">As all processes are killed by <a class="Xr">init(8)</a> at - shutdown, the explicit <a class="Xr">kill(1)</a> is unnecessary, but is - often included.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">kill(1)</a>, <a class="Xr">rc.conf(5)</a>, - <a class="Xr">init(8)</a>, <a class="Xr">rc.resume(8)</a>, - <a class="Xr">rc.subr(8)</a>, <a class="Xr">rcorder(8)</a>, - <a class="Xr">reboot(8)</a>, <a class="Xr">savecore(8)</a>, - <a class="Xr">service(8)</a>, <a class="Xr">sysrc(8)</a></p> -<p class="Pp"></p> -<p class="Pp"><cite class="Rs"><span class="RsT">Practical rc.d scripting in - BSD</span>, - <a class="RsU" href="<https://docs.freebsd.org/en/articles/rc-scripting/>"><https://docs.freebsd.org/en/articles/rc-scripting/></a>.</cite></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> -<p class="Pp">The <code class="Nm">rc</code> utility appeared in - <span class="Ux">4.0BSD</span>.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">September 20, 2024</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> diff --git a/static/freebsd/man8/rc.subr.8 3.html b/static/freebsd/man8/rc.subr.8 3.html deleted file mode 100644 index 582ece18..00000000 --- a/static/freebsd/man8/rc.subr.8 3.html +++ /dev/null @@ -1,806 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">RC.SUBR(8)</td> - <td class="head-vol">System Manager's Manual</td> - <td class="head-rtitle">RC.SUBR(8)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">rc.subr</code> — - <span class="Nd">functions used by system shell scripts</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> -<ul class="Bl-item Bl-compact"> - <li id="."><a class="permalink" href="#."><code class="Ic">.</code></a> - <span class="Pa">/etc/rc.subr</span> - <p class="Pp"></p> - </li> - <li id="backup_file"><a class="permalink" href="#backup_file"><code class="Ic">backup_file</code></a> - <var class="Ar">action</var> <var class="Ar">file</var> - <var class="Ar">current</var> <var class="Ar">backup</var></li> - <li id="checkyesno"><a class="permalink" href="#checkyesno"><code class="Ic">checkyesno</code></a> - <var class="Ar">var</var></li> - <li id="check_pidfile"><a class="permalink" href="#check_pidfile"><code class="Ic">check_pidfile</code></a> - <var class="Ar">pidfile</var> <var class="Ar">procname</var> - [<var class="Ar">interpreter</var>]</li> - <li id="check_process"><a class="permalink" href="#check_process"><code class="Ic">check_process</code></a> - <var class="Ar">procname</var> [<var class="Ar">interpreter</var>]</li> - <li id="DebugOn"><a class="permalink" href="#DebugOn"><code class="Ic">DebugOn</code></a> - <var class="Ar">tag ...</var></li> - <li id="DebugOff"><a class="permalink" href="#DebugOff"><code class="Ic">DebugOff</code></a> - <var class="Ar">tag ...</var></li> - <li id="debug"><a class="permalink" href="#debug"><code class="Ic">debug</code></a> - <var class="Ar">message</var></li> - <li id="dot"><a class="permalink" href="#dot"><code class="Ic">dot</code></a> - <var class="Ar">file ...</var></li> - <li id="err"><a class="permalink" href="#err"><code class="Ic">err</code></a> - <var class="Ar">exitval</var> <var class="Ar">message</var></li> - <li id="force_depend"><a class="permalink" href="#force_depend"><code class="Ic">force_depend</code></a> - <var class="Ar">name</var></li> - <li id="info"><a class="permalink" href="#info"><code class="Ic">info</code></a> - <var class="Ar">message</var></li> - <li id="is_verified"><a class="permalink" href="#is_verified"><code class="Ic">is_verified</code></a> - <var class="Ar">file</var></li> - <li id="load_kld"><a class="permalink" href="#load_kld"><code class="Ic">load_kld</code></a> - [<code class="Fl">-e</code> <var class="Ar">regex</var>] - [<code class="Fl">-m</code> <var class="Ar">module</var>] - <var class="Ar">file</var></li> - <li id="load_rc_config"><a class="permalink" href="#load_rc_config"><code class="Ic">load_rc_config</code></a> - [<var class="Ar">flag</var>] [<var class="Ar">service</var>]</li> - <li id="load_rc_config_var"><a class="permalink" href="#load_rc_config_var"><code class="Ic">load_rc_config_var</code></a> - <var class="Ar">name</var> <var class="Ar">var</var></li> - <li id="mount_critical_filesystems"><a class="permalink" href="#mount_critical_filesystems"><code class="Ic">mount_critical_filesystems</code></a> - <var class="Ar">type</var></li> - <li id="rc_log"><a class="permalink" href="#rc_log"><code class="Ic">rc_log</code></a> - <var class="Ar">message</var></li> - <li id="rc_trace"><a class="permalink" href="#rc_trace"><code class="Ic">rc_trace</code></a> - <var class="Ar">level</var> <var class="Ar">message</var></li> - <li id="rc_usage"><a class="permalink" href="#rc_usage"><code class="Ic">rc_usage</code></a> - <var class="Ar">command ...</var></li> - <li id="reverse_list"><a class="permalink" href="#reverse_list"><code class="Ic">reverse_list</code></a> - <var class="Ar">item ...</var></li> - <li id="run_rc_command"><a class="permalink" href="#run_rc_command"><code class="Ic">run_rc_command</code></a> - <var class="Ar">argument</var></li> - <li id="run_rc_script"><a class="permalink" href="#run_rc_script"><code class="Ic">run_rc_script</code></a> - <var class="Ar">file</var> <var class="Ar">argument</var></li> - <li id="run_rc_scripts"><a class="permalink" href="#run_rc_scripts"><code class="Ic">run_rc_scripts</code></a> - [options] <var class="Ar">file ...</var></li> - <li id="safe_dot"><a class="permalink" href="#safe_dot"><code class="Ic">safe_dot</code></a> - <var class="Ar">file ...</var></li> - <li id="sdot"><a class="permalink" href="#sdot"><code class="Ic">sdot</code></a> - <var class="Ar">file ...</var></li> - <li id="startmsg"><a class="permalink" href="#startmsg"><code class="Ic">startmsg</code></a> - [<code class="Fl">-n</code>] <var class="Ar">message</var></li> - <li id="vdot"><a class="permalink" href="#vdot"><code class="Ic">vdot</code></a> - <var class="Ar">file ...</var></li> - <li id="wait_for_pids"><a class="permalink" href="#wait_for_pids"><code class="Ic">wait_for_pids</code></a> - [<var class="Ar">pid ...</var>]</li> - <li id="warn"><a class="permalink" href="#warn"><code class="Ic">warn</code></a> - <var class="Ar">message</var></li> -</ul> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">The <code class="Nm">rc.subr</code> script contains commonly used - shell script functions and variable definitions which are used by various - scripts such as <a class="Xr">rc(8)</a>. Scripts required by ports in - <span class="Pa">/usr/local/etc/rc.d</span> will also eventually be - rewritten to make use of it.</p> -<p class="Pp">The <code class="Nm">rc.subr</code> functions were mostly imported - from <span class="Ux">NetBSD</span>.</p> -<p class="Pp">They are accessed by sourcing <span class="Pa">/etc/rc.subr</span> - into the current shell.</p> -<p class="Pp">The following shell functions are available:</p> -<dl class="Bl-tag"> - <dt id="backup_file~2"><a class="permalink" href="#backup_file~2"><code class="Ic">backup_file</code></a> - <var class="Ar">action file current backup</var></dt> - <dd>Make a backup copy of <var class="Ar">file</var> into - <var class="Ar">current</var>. Save the previous version of - <var class="Ar">current</var> as <var class="Ar">backup</var>. - <p class="Pp">The <var class="Ar">action</var> argument may be one of the - following:</p> - <dl class="Bl-tag"> - <dt id="add"><a class="permalink" href="#add"><code class="Cm">add</code></a></dt> - <dd><var class="Ar">file</var> is now being backed up by or possibly - re-entered into this backup mechanism. <var class="Ar">current</var> - is created.</dd> - <dt id="update"><a class="permalink" href="#update"><code class="Cm">update</code></a></dt> - <dd><var class="Ar">file</var> has changed and needs to be backed up. If - <var class="Ar">current</var> exists, it is copied to - <var class="Ar">backup</var> and then <var class="Ar">file</var> is - copied to <var class="Ar">current</var>.</dd> - <dt id="remove"><a class="permalink" href="#remove"><code class="Cm">remove</code></a></dt> - <dd><var class="Ar">file</var> is no longer being tracked by this backup - mechanism. <var class="Ar">current</var> is moved to - <var class="Ar">backup</var>.</dd> - </dl> - </dd> - <dt id="checkyesno~2"><a class="permalink" href="#checkyesno~2"><code class="Ic">checkyesno</code></a> - <var class="Ar">var</var></dt> - <dd>Return 0 if <var class="Ar">var</var> is defined to - “<code class="Li">YES</code>”, - “<code class="Li">TRUE</code>”, - “<code class="Li">ON</code>”, or - ‘<code class="Li">1</code>’. Return 1 if - <var class="Ar">var</var> is defined to - “<code class="Li">NO</code>”, - “<code class="Li">FALSE</code>”, - “<code class="Li">OFF</code>”, or - ‘<code class="Li">0</code>’. Otherwise, warn that - <var class="Ar">var</var> is not set correctly. The values are case - insensitive. <i class="Em">Note</i>: <var class="Ar">var</var> should be a - variable name, not its value; <code class="Ic">checkyesno</code> will - expand the variable by itself.</dd> - <dt id="check_pidfile~2"><a class="permalink" href="#check_pidfile~2"><code class="Ic">check_pidfile</code></a> - <var class="Ar">pidfile procname</var> - [<var class="Ar">interpreter</var>]</dt> - <dd>Parses the first word of the first line of <var class="Ar">pidfile</var> - for a PID, and ensures that the process with that PID is running and its - first argument matches <var class="Ar">procname</var>. Prints the matching - PID if successful, otherwise nothing. If <var class="Ar">interpreter</var> - is provided, parse the first line of <var class="Ar">procname</var>, - ensure that the line is of the form: - <p class="Pp"></p> - <div class="Bd Bd-indent"><code class="Li">#! interpreter [...]</code></div> - <p class="Pp">and use <var class="Ar">interpreter</var> with its optional - arguments and <var class="Ar">procname</var> appended as the process - string to search for.</p> - </dd> - <dt id="check_process~2"><a class="permalink" href="#check_process~2"><code class="Ic">check_process</code></a> - <var class="Ar">procname</var> [<var class="Ar">interpreter</var>]</dt> - <dd>Prints the PIDs of any processes that are running with a first argument - that matches <var class="Ar">procname</var>. - <var class="Ar">interpreter</var> is handled as per - <code class="Ic">check_pidfile</code>.</dd> - <dt id="DebugOn~2"><a class="permalink" href="#DebugOn~2"><code class="Ic">DebugOn</code></a> - <var class="Ar">tag ...</var></dt> - <dd>Enable tracing if not already enabled, and any <var class="Ar">tag</var> - is found in <var class="Va">DEBUG_SH</var> (a comma separated list of - tags). - <p class="Pp">Record the <var class="Ar">tag</var> that caused it to be - enabled in <var class="Va">DEBUG_ON</var>, set - <var class="Va">DEBUG_DO</var> empty and - <var class="Va">DEBUG_SKIP</var> to - ‘<code class="Li">:</code>’.</p> - <p class="Pp">See <a class="Xr">debug.sh(8)</a> for more details.</p> - </dd> - <dt id="DebugOff~2"><a class="permalink" href="#DebugOff~2"><code class="Ic">DebugOff</code></a> - <var class="Ar">tag ...</var></dt> - <dd>Disable tracing if enabled and any <var class="Ar">tag</var> matches - <var class="Va">DEBUG_ON</var>, which means it was the reason tracing was - enabled. - <p class="Pp">Set <var class="Va">DEBUG_DO</var> to - ‘<code class="Li">:</code>’, and - <var class="Va">DEBUG_ON</var>, <var class="Va">DEBUG_SKIP</var> - empty.</p> - </dd> - <dt id="debug~2"><a class="permalink" href="#debug~2"><code class="Ic">debug</code></a> - <var class="Ar">message</var></dt> - <dd>Display a debugging message to <var class="Va">stderr</var>, log it to the - system log using <a class="Xr">logger(1)</a>, and return to the caller. - The error message consists of the script name (from - <var class="Va">$0</var>), followed by “<code class="Li">: DEBUG: - </code>”, and then <var class="Ar">message</var>. This function is - intended to be used by developers as an aid to debugging scripts. It can - be turned on or off by the <a class="Xr">rc.conf(5)</a> variable - <var class="Va">rc_debug</var>.</dd> - <dt id="dot~2"><a class="permalink" href="#dot~2"><code class="Ic">dot</code></a> - <var class="Ar">file ...</var></dt> - <dd>For reading in unverified files. - <p class="Pp">Ensure shell <code class="Li">verify</code> option is off. - This option is only meaningful when <a class="Xr">mac_veriexec(4)</a> is - active.</p> - <p class="Pp">Read each <var class="Ar">file</var> if it exists.</p> - <p class="Pp">Restore previous state of the <code class="Li">verify</code> - option.</p> - </dd> - <dt id="err~2"><a class="permalink" href="#err~2"><code class="Ic">err</code></a> - <var class="Ar">exitval message</var></dt> - <dd>Display an error message to <var class="Va">stderr</var>, log it to the - system log using <a class="Xr">logger(1)</a>, and - <code class="Ic">exit</code> with an exit value of - <var class="Ar">exitval</var>. The error message consists of the script - name (from <var class="Va">$0</var>), followed by - “<code class="Li">: ERROR: </code>”, and then - <var class="Ar">message</var>.</dd> - <dt id="force_depend~2"><a class="permalink" href="#force_depend~2"><code class="Ic">force_depend</code></a> - <var class="Ar">name</var></dt> - <dd>Output an advisory message and force the <var class="Ar">name</var> - service to start. The <var class="Ar">name</var> argument is the - <a class="Xr">basename(1)</a> component of the path to the script located - at <span class="Pa">/etc/rc.d</span> (scripts stored in other locations - such as <span class="Pa">/usr/local/etc/rc.d</span> cannot be controlled - with <code class="Ic">force_depend</code> currently). If the script fails - for any reason it will output a warning and return with a return value of - 1. If it was successful it will return 0.</dd> - <dt id="is_verified~2"><a class="permalink" href="#is_verified~2"><code class="Ic">is_verified</code></a> - <var class="Ar">file</var></dt> - <dd>If <a class="Xr">veriexec(8)</a> does not exist, or - <a class="Xr">mac_veriexec(4)</a> is not active, just return success. - Otherwise use <a class="Xr">veriexec(8)</a> to check if - <var class="Ar">file</var> is verified. If not verified the return code - will be 80 (EAUTH).</dd> - <dt id="info~2"><a class="permalink" href="#info~2"><code class="Ic">info</code></a> - <var class="Ar">message</var></dt> - <dd>Display an informational message to <var class="Va">stdout</var>, and log - it to the system log using <a class="Xr">logger(1)</a>. The message - consists of the script name (from <var class="Va">$0</var>), followed by - “<code class="Li">: INFO: </code>”, and then - <var class="Ar">message</var>. The display of this informational output - can be turned on or off by the <a class="Xr">rc.conf(5)</a> variable - <var class="Va">rc_info</var>.</dd> - <dt id="load_kld~2"><a class="permalink" href="#load_kld~2"><code class="Ic">load_kld</code></a> - [<code class="Fl">-e</code> <var class="Ar">regex</var>] - [<code class="Fl">-m</code> <var class="Ar">module</var>] - <var class="Ar">file</var></dt> - <dd>Load <var class="Ar">file</var> as a kernel module unless it is already - loaded. For the purpose of checking the module status, either the exact - module name can be specified using <code class="Fl">-m</code>, or an - <a class="Xr">egrep(1)</a> regular expression matching the module name can - be supplied via <code class="Fl">-e</code>. By default, the module is - assumed to have the same name as <var class="Ar">file</var>, which is not - always the case.</dd> - <dt id="load_rc_config~2"><a class="permalink" href="#load_rc_config~2"><code class="Ic">load_rc_config</code></a> - [<var class="Ar">flag</var>] [<var class="Ar">service</var>]</dt> - <dd>Source in the configuration file(s) for <var class="Ar">service</var>. If - no <var class="Ar">service</var> is specified, only the global - configuration file(s) will be loaded. First, - <span class="Pa">/etc/rc.conf</span> is sourced if it has not yet been - read in. Then, - <span class="Pa">/etc/rc.conf.d/</span><var class="Ar">service</var> is - sourced if it is an existing file. The latter may also contain other - variable assignments to override <code class="Ic">run_rc_command</code> - arguments defined by the calling script, to provide an easy mechanism for - an administrator to override the behaviour of a given - <a class="Xr">rc.d(8)</a> script without requiring the editing of that - script. - <p class="Pp">The function named by - <var class="Va">load_rc_config_reader</var> (default is - <code class="Ic">dot</code>) is used to read configuration unless - <var class="Ar">flag</var> is:</p> - <dl class="Bl-tag"> - <dt id="s"><a class="permalink" href="#s"><code class="Fl">-s</code></a></dt> - <dd>use <code class="Ic">sdot</code> to read configuration, because we - want verified configuration or to use <code class="Ic">safe_dot</code> - to read an unverified configuration.</dd> - <dt id="v"><a class="permalink" href="#v"><code class="Fl">-v</code></a></dt> - <dd>use <code class="Ic">vdot</code> to read in configuration only if it - is verified.</dd> - </dl> - <p class="Pp"><code class="Ic">DebugOn</code> will be called with tags - derived from <var class="Ar">name</var> to enable tracing if any appear - in <var class="Va">DEBUG_SH</var>.</p> - </dd> - <dt id="load_rc_config_var~2"><a class="permalink" href="#load_rc_config_var~2"><code class="Ic">load_rc_config_var</code></a> - <var class="Ar">name</var> <var class="Ar">var</var></dt> - <dd>Read the <a class="Xr">rc.conf(5)</a> variable <var class="Ar">var</var> - for <var class="Ar">name</var> and set in the current shell, using - <code class="Ic">load_rc_config</code> in a sub-shell to prevent unwanted - side effects from other variable assignments.</dd> - <dt id="mount_critical_filesystems~2"><a class="permalink" href="#mount_critical_filesystems~2"><code class="Ic">mount_critical_filesystems</code></a> - <var class="Ar">type</var></dt> - <dd>Go through a list of critical file systems, as found in the - <a class="Xr">rc.conf(5)</a> variable - <var class="Va">critical_filesystems_</var><var class="Ar">type</var>, - mounting each one that is not currently mounted.</dd> - <dt id="rc_log~2"><a class="permalink" href="#rc_log~2"><code class="Ic">rc_log</code></a> - <var class="Ar">message</var></dt> - <dd>Output <var class="Ar">message</var> with a timestamp, which is both human - readable and easily parsed for post processing, using: - <div class="Bd Pp Bd-indent Li"> - <pre>date "+@ %s [%Y-%m-%d %H:%M:%S %Z] $*"</pre> - </div> - </dd> - <dt id="rc_trace~2"><a class="permalink" href="#rc_trace~2"><code class="Ic">rc_trace</code></a> - <var class="Ar">level</var> <var class="Ar">message</var></dt> - <dd>If the file <span class="Pa">/etc/rc.conf.d/rc_trace</span> exists and is - not empty attempt to set <var class="Va">RC_LEVEL</var> based on its - content. If the file is empty or does not contain a value for - <var class="Va">RC_LEVEL</var>, set it to <code class="Li">0</code>. - <p class="Pp">If <var class="Ar">level</var> is greater than or equal to - <var class="Va">RC_LEVEL</var> pass <var class="Ar">message</var> to - <code class="Ic">rc_log</code>.</p> - </dd> - <dt id="rc_usage~2"><a class="permalink" href="#rc_usage~2"><code class="Ic">rc_usage</code></a> - <var class="Ar">command ...</var></dt> - <dd>Print a usage message for <var class="Va">$0</var>, with - <var class="Ar">commands</var> being the list of valid arguments prefixed - by - “[<code class="Li">fast</code>|<code class="Li">force</code>|<code class="Li">one</code>|<code class="Li">quiet</code>]”.</dd> - <dt id="reverse_list~2"><a class="permalink" href="#reverse_list~2"><code class="Ic">reverse_list</code></a> - <var class="Ar">item ...</var></dt> - <dd>Print the list of <var class="Ar">items</var> in reverse order.</dd> - <dt id="run_rc_command~2"><a class="permalink" href="#run_rc_command~2"><code class="Ic">run_rc_command</code></a> - <var class="Ar">argument</var></dt> - <dd>Run the <var class="Ar">argument</var> method for the current - <a class="Xr">rc.d(8)</a> script, based on the settings of various shell - variables. <code class="Ic">run_rc_command</code> is extremely flexible, - and allows fully functional <a class="Xr">rc.d(8)</a> scripts to be - implemented in a small amount of shell code. - <p class="Pp"><var class="Ar">argument</var> is searched for in the list of - supported commands, which may be one of:</p> - <div class="Bd-indent"> - <dl class="Bl-tag"> - <dt id="start"><a class="permalink" href="#start"><code class="Cm">start</code></a></dt> - <dd>Start the service. This should check that the service is to be started - as specified by <a class="Xr">rc.conf(5)</a>. Also checks if the - service is already running and refuses to start if it is. This latter - check is not performed by standard <span class="Ux">FreeBSD</span> - scripts if the system is starting directly to multi-user mode, to - speed up the boot process.</dd> - <dt id="stop"><a class="permalink" href="#stop"><code class="Cm">stop</code></a></dt> - <dd>If the service is to be started as specified by - <a class="Xr">rc.conf(5)</a>, stop the service. This should check that - the service is running and complain if it is not.</dd> - <dt id="restart"><a class="permalink" href="#restart"><code class="Cm">restart</code></a></dt> - <dd>Perform a <code class="Cm">stop</code> then a - <code class="Cm">start</code>. Defaults to displaying the process ID - of the program (if running).</dd> - <dt id="enabled"><a class="permalink" href="#enabled"><code class="Cm">enabled</code></a></dt> - <dd>Return 0 if the service is enabled and 1 if it is not. This command - does not print anything.</dd> - <dt id="rcvar"><a class="permalink" href="#rcvar"><code class="Cm">rcvar</code></a></dt> - <dd>Display which <a class="Xr">rc.conf(5)</a> variables are used to - control the startup of the service (if any).</dd> - </dl> - </div> - <p class="Pp">If <var class="Va">pidfile</var> or - <var class="Va">procname</var> is set, also support:</p> - <div class="Bd-indent"> - <dl class="Bl-tag"> - <dt id="poll"><a class="permalink" href="#poll"><code class="Cm">poll</code></a></dt> - <dd>Wait for the command to exit.</dd> - <dt id="status"><a class="permalink" href="#status"><code class="Cm">status</code></a></dt> - <dd>Show the status of the process.</dd> - </dl> - </div> - <p class="Pp">Other supported commands are listed in the optional variable - <var class="Va">extra_commands</var>.</p> - <p class="Pp"><var class="Ar">argument</var> may have one of the following - prefixes which alters its operation:</p> - <div class="Bd-indent"> - <dl class="Bl-tag"> - <dt id="fast"><a class="permalink" href="#fast"><code class="Li">fast</code></a></dt> - <dd>Skip the check for an existing running process, and sets - <var class="Va">rc_fast</var>=<code class="Li">YES</code>.</dd> - <dt id="force"><a class="permalink" href="#force"><code class="Li">force</code></a></dt> - <dd>Skip the checks for <var class="Va">rcvar</var> being set to - “<code class="Li">YES</code>”, and sets - <var class="Va">rc_force</var>=<code class="Li">YES</code>. This - ignores <var class="Ar">argument</var><var class="Va">_precmd</var> - returning non-zero, and ignores any of the - <var class="Va">required_*</var> tests failing, and always returns a - zero exit status.</dd> - <dt id="one"><a class="permalink" href="#one"><code class="Li">one</code></a></dt> - <dd>Skip the checks for <var class="Va">rcvar</var> being set to - “<code class="Li">YES</code>”, but performs all the - other prerequisite tests.</dd> - <dt id="quiet"><a class="permalink" href="#quiet"><code class="Li">quiet</code></a></dt> - <dd>Inhibits some verbose diagnostics. Currently, this includes messages - "Starting ${name}" (as checked by - <code class="Ic">check_startmsgs</code> inside - <code class="Nm">rc.subr</code>) and errors about usage of services - that are not enabled in <a class="Xr">rc.conf(5)</a>. This prefix also - sets <var class="Va">rc_quiet</var>=<code class="Li">YES</code>. - <i class="Em">Note</i>: <var class="Va">rc_quiet</var> is not intended - to completely mask all debug and warning messages, but only certain - small classes of them.</dd> - </dl> - </div> - <p class="Pp"><code class="Ic">run_rc_command</code> uses the following - shell variables to control its behaviour. Unless otherwise stated, these - are optional.</p> - <div class="Bd-indent"> - <dl class="Bl-tag"> - <dt id="name"><var class="Va">name</var></dt> - <dd>The name of this script. This is not optional.</dd> - <dt id="rcvar~2"><var class="Va">rcvar</var></dt> - <dd>The value of <var class="Va">rcvar</var> is checked with - <code class="Ic">checkyesno</code> to determine if this method should - be run.</dd> - <dt id="command"><var class="Va">command</var></dt> - <dd>Full path to the command. Not required if - <var class="Ar">argument</var><var class="Va">_cmd</var> is defined - for each supported keyword. Can be overridden by - <var class="Va">${name}_program</var>.</dd> - <dt id="command_args"><var class="Va">command_args</var></dt> - <dd>Optional arguments and/or shell directives for - <var class="Va">command</var>.</dd> - <dt id="command_interpreter"><var class="Va">command_interpreter</var></dt> - <dd><var class="Va">command</var> is started with: - <p class="Pp"></p> - <div class="Bd Bd-indent"><code class="Li">#! command_interpreter - [...]</code></div> - <p class="Pp">which results in its <a class="Xr">ps(1)</a> command - being:</p> - <p class="Pp"></p> - <div class="Bd Bd-indent"><code class="Li">command_interpreter [...] - command</code></div> - <p class="Pp">so use that string to find the PID(s) of the running - command rather than <var class="Va">command</var>.</p> - </dd> - <dt id="extra_commands"><var class="Va">extra_commands</var></dt> - <dd>Extra commands/keywords/arguments supported.</dd> - <dt id="pidfile"><var class="Va">pidfile</var></dt> - <dd>Path to PID file. Used to determine the PID(s) of the running command. - If <var class="Va">pidfile</var> is set, use: - <p class="Pp"></p> - <div class="Bd Bd-indent"><code class="Li">check_pidfile $pidfile - $procname</code></div> - <p class="Pp">to find the PID. Otherwise, if - <var class="Va">command</var> is set, use:</p> - <p class="Pp"></p> - <div class="Bd Bd-indent"><code class="Li">check_process - $procname</code></div> - <p class="Pp">to find the PID.</p> - </dd> - <dt id="procname"><var class="Va">procname</var></dt> - <dd>Process name to check for. Defaults to the value of - <var class="Va">command</var>.</dd> - <dt id="required_dirs"><var class="Va">required_dirs</var></dt> - <dd>Check for the existence of the listed directories before running the - <code class="Cm">start</code> method. The list is checked before - running <var class="Va">start_precmd</var>.</dd> - <dt id="required_files"><var class="Va">required_files</var></dt> - <dd>Check for the readability of the listed files before running the - <code class="Cm">start</code> method. The list is checked before - running <var class="Va">start_precmd</var>.</dd> - <dt id="required_modules"><var class="Va">required_modules</var></dt> - <dd>Ensure that the listed kernel modules are loaded before running the - <code class="Cm">start</code> method. The list is checked after - running <var class="Va">start_precmd</var>. This is done after - invoking the commands from <var class="Va">start_precmd</var> so that - the missing modules are not loaded in vain if the preliminary commands - indicate a error condition. A word in the list can have an optional - “<code class="Li">:</code><var class="Ar">modname</var>” - or - “<code class="Li">~</code><var class="Ar">pattern</var>” - suffix. The <var class="Ar">modname</var> or - <var class="Ar">pattern</var> parameter is passed to - <code class="Ic">load_kld</code> through a <code class="Fl">-m</code> - or <code class="Fl">-e</code> option, respectively. See the - description of <code class="Ic">load_kld</code> in this document for - details.</dd> - <dt id="required_vars"><var class="Va">required_vars</var></dt> - <dd>Perform <code class="Ic">checkyesno</code> on each of the list - variables before running the <code class="Cm">start</code> method. The - list is checked after running <var class="Va">start_precmd</var>.</dd> - <dt id="$_name__chdir"><var class="Va">${name}_chdir</var></dt> - <dd>Directory to <code class="Ic">cd</code> to before running - <var class="Va">command</var>, if <var class="Va">${name}_chroot</var> - is not provided.</dd> - <dt id="$_name__chroot"><var class="Va">${name}_chroot</var></dt> - <dd>Directory to <a class="Xr">chroot(8)</a> to before running - <var class="Va">command</var>. Only supported after - <span class="Pa">/usr</span> is mounted.</dd> - <dt id="$_name__env"><var class="Va">${name}_env</var></dt> - <dd>A list of environment variables to run <var class="Va">command</var> - with. Those variables will be passed as arguments to the - <a class="Xr">env(1)</a> utility unless - <var class="Ar">argument</var><var class="Va">_cmd</var> is defined. - In that case the contents of <var class="Va">${name}_env</var> will be - exported via the <a class="Xr">export(1)</a> builtin of - <a class="Xr">sh(1)</a>, which puts some limitations on the names of - variables (e.g., a variable name may not start with a digit).</dd> - <dt id="$_name__env_file"><var class="Va">${name}_env_file</var></dt> - <dd>A file to source for environmental variables to run - <var class="Va">command</var> with. <i class="Em">Note</i>: all the - variables which are being assigned in this file are going to be - exported into the environment of <var class="Va">command</var>.</dd> - <dt id="$_name__fib"><var class="Va">${name}_fib</var></dt> - <dd>FIB <span class="Pa">Routing Table</span> number to run - <var class="Va">command</var> with. See <a class="Xr">setfib(1)</a> - for more details.</dd> - <dt id="$_name__flags"><var class="Va">${name}_flags</var></dt> - <dd>Arguments to call <var class="Va">command</var> with. This is usually - set in <a class="Xr">rc.conf(5)</a>, and not in the - <a class="Xr">rc.d(8)</a> script. The environment variable - ‘<code class="Ev">flags</code>’ can be used to override - this.</dd> - <dt id="$_name__nice"><var class="Va">${name}_nice</var></dt> - <dd><a class="Xr">nice(1)</a> level to run <var class="Va">command</var> - as. Only supported after <span class="Pa">/usr</span> is mounted.</dd> - <dt id="$_name__limits"><var class="Va">${name}_limits</var></dt> - <dd>Resource limits to apply to <var class="Va">command</var>. This will - be passed as arguments to the <a class="Xr">limits(1)</a> utility. By - default, the resource limits are based on the login class defined in - <var class="Va">${name}_login_class</var>.</dd> - <dt id="$_name__login_class"><var class="Va">${name}_login_class</var></dt> - <dd>Login class to use with <var class="Va">${name}_limits</var>. Defaults - to “<code class="Li">daemon</code>”.</dd> - <dt id="$_name__offcmd"><var class="Va">${name}_offcmd</var></dt> - <dd>Shell commands to run during start if a service is not enabled.</dd> - <dt id="$_name__oomprotect"><var class="Va">${name}_oomprotect</var></dt> - <dd><a class="Xr">protect(1)</a> <var class="Va">command</var> from being - killed when swap space is exhausted. If - “<code class="Li">YES</code>” is used, no child - processes are protected. If - “<code class="Li">ALL</code>”, protect all child - processes.</dd> - <dt id="$_name__program"><var class="Va">${name}_program</var></dt> - <dd>Full path to the command. Overrides <var class="Va">command</var> if - both are set, but has no effect if <var class="Va">command</var> is - unset. As a rule, <var class="Va">command</var> should be set in the - script while <var class="Va">${name}_program</var> should be set in - <a class="Xr">rc.conf(5)</a>.</dd> - <dt id="$_name__user"><var class="Va">${name}_user</var></dt> - <dd>User to run <var class="Va">command</var> as, using - <a class="Xr">chroot(8)</a> if <var class="Va">${name}_chroot</var> is - set, otherwise uses <a class="Xr">su(1)</a>. Only supported after - <span class="Pa">/usr</span> is mounted.</dd> - <dt id="$_name__group"><var class="Va">${name}_group</var></dt> - <dd>Group to run the chrooted <var class="Va">command</var> as.</dd> - <dt id="$_name__groups"><var class="Va">${name}_groups</var></dt> - <dd>Comma separated list of supplementary groups to run the chrooted - <var class="Va">command</var> with.</dd> - <dt id="$_name__prepend"><var class="Va">${name}_prepend</var></dt> - <dd>Commands to be prepended to <var class="Va">command</var>. This is a - generic version of <var class="Va">${name}_env</var>, - <var class="Va">${name}_fib</var>, or - <var class="Va">${name}_nice</var>.</dd> - <dt id="$_name__setup"><var class="Va">${name}_setup</var></dt> - <dd>Optional command to be run during <code class="Cm">start</code>, - <code class="Cm">restart</code>, and <code class="Cm">reload</code> - prior to the respective - <var class="Ar">argument</var><var class="Va">_precmd</var>. If the - command fails for any reason it will output a warning, but execution - will continue.</dd> - <dt><var class="Ar">argument</var><var class="Va">_cmd</var></dt> - <dd>Shell commands which override the default method for - <var class="Ar">argument</var>.</dd> - <dt><var class="Ar">argument</var><var class="Va">_precmd</var></dt> - <dd>Shell commands to run just before running - <var class="Ar">argument</var><var class="Va">_cmd</var> or the - default method for <var class="Ar">argument</var>. If this returns a - non-zero exit code, the main method is not performed. If the default - method is being executed, this check is performed after the - <var class="Va">required_*</var> checks and process (non-)existence - checks.</dd> - <dt><var class="Ar">argument</var><var class="Va">_postcmd</var></dt> - <dd>Shell commands to run if running - <var class="Ar">argument</var><var class="Va">_cmd</var> or the - default method for <var class="Ar">argument</var> returned a zero exit - code.</dd> - <dt id="sig_stop"><var class="Va">sig_stop</var></dt> - <dd>Signal to send the processes to stop in the default - <code class="Cm">stop</code> method. Defaults to - <code class="Dv">SIGTERM</code>.</dd> - <dt id="sig_reload"><var class="Va">sig_reload</var></dt> - <dd>Signal to send the processes to reload in the default - <code class="Cm">reload</code> method. Defaults to - <code class="Dv">SIGHUP</code>.</dd> - </dl> - </div> - <p class="Pp">For a given method <var class="Ar">argument</var>, if - <var class="Ar">argument</var><var class="Va">_cmd</var> is not defined, - then a default method is provided by - <code class="Ic">run_rc_command</code>:</p> - <table class="Bl-column Bd-indent"> - <tr id="Argument"> - <td><a class="permalink" href="#Argument"><b class="Sy">Argument</b></a></td> - <td><a class="permalink" href="#Default"><b class="Sy" id="Default">Default - method</b></a></td> - </tr> - <tr id="start~2"> - <td><a class="permalink" href="#start~2"><code class="Cm">start</code></a></td> - <td>If <var class="Va">command</var> is not running and - <code class="Ic">checkyesno</code> <var class="Va">rcvar</var> - succeeds, start <var class="Va">command</var>.</td> - </tr> - <tr id="stop~2"> - <td><a class="permalink" href="#stop~2"><code class="Cm">stop</code></a></td> - <td>Determine the PIDs of <var class="Va">command</var> with - <code class="Ic">check_pidfile</code> or - <code class="Ic">check_process</code> (as appropriate), - <code class="Ic">kill</code> <var class="Va">sig_stop</var> those - PIDs, and run <code class="Ic">wait_for_pids</code> on those - PIDs.</td> - </tr> - <tr id="reload"> - <td><a class="permalink" href="#reload"><code class="Cm">reload</code></a></td> - <td>Similar to <code class="Cm">stop</code>, except that it uses - <var class="Va">sig_reload</var> instead, and does not run - <code class="Ic">wait_for_pids</code>. Another difference from - <code class="Cm">stop</code> is that <code class="Cm">reload</code> is - not provided by default. It can be enabled via - <var class="Va">extra_commands</var> if appropriate: - <p class="Pp"></p> - <div class="Bd - Bd-indent"><code class="Li">extra_commands=reload</code></div> - </td> - </tr> - <tr id="restart~2"> - <td><a class="permalink" href="#restart~2"><code class="Cm">restart</code></a></td> - <td>Runs the <code class="Cm">stop</code> method, then the - <code class="Cm">start</code> method.</td> - </tr> - <tr id="status~2"> - <td><a class="permalink" href="#status~2"><code class="Cm">status</code></a></td> - <td>Show the PID of <var class="Va">command</var>, or some other script - specific status operation.</td> - </tr> - <tr id="poll~2"> - <td><a class="permalink" href="#poll~2"><code class="Cm">poll</code></a></td> - <td>Wait for <var class="Va">command</var> to exit.</td> - </tr> - <tr id="rcvar~3"> - <td><a class="permalink" href="#rcvar~3"><code class="Cm">rcvar</code></a></td> - <td>Display which <a class="Xr">rc.conf(5)</a> variable is used (if - any). This method always works, even if the appropriate - <a class="Xr">rc.conf(5)</a> variable is set to - “<code class="Li">NO</code>”.</td> - </tr> - </table> - <p class="Pp">The following variables are available to the methods (such as - <var class="Ar">argument</var><var class="Va">_cmd</var>) as well as - after <code class="Ic">run_rc_command</code> has completed:</p> - <div class="Bd-indent"> - <dl class="Bl-tag"> - <dt id="rc_arg"><var class="Va">rc_arg</var></dt> - <dd>Argument provided to <code class="Ic">run_rc_command</code>, after - fast and force processing has been performed.</dd> - <dt id="rc_flags"><var class="Va">rc_flags</var></dt> - <dd>Flags to start the default command with. Defaults to - <var class="Va">${name}_flags</var>, unless overridden by the - environment variable ‘<code class="Ev">flags</code>’. - This variable may be changed by the - <var class="Ar">argument</var><var class="Va">_precmd</var> - method.</dd> - <dt id="rc_service"><var class="Va">rc_service</var></dt> - <dd>Path to the service script being executed, in case it needs to - re-invoke itself.</dd> - <dt id="rc_pid"><var class="Va">rc_pid</var></dt> - <dd>PID of <var class="Va">command</var> (if appropriate).</dd> - <dt id="rc_fast"><var class="Va">rc_fast</var></dt> - <dd>Not empty if “<code class="Li">fast</code>” prefix was - used.</dd> - <dt id="rc_force"><var class="Va">rc_force</var></dt> - <dd>Not empty if “<code class="Li">force</code>” prefix was - used.</dd> - </dl> - </div> - </dd> - <dt id="run_rc_script~2"><a class="permalink" href="#run_rc_script~2"><code class="Ic">run_rc_script</code></a> - <var class="Ar">file argument</var></dt> - <dd>Start the script <var class="Ar">file</var> with an argument of - <var class="Ar">argument</var>, and handle the return value from the - script. - <p class="Pp">Various shell variables are unset before - <var class="Ar">file</var> is started:</p> - <div class="Bd Pp Bd-indent"><var class="Va">name</var>, - <var class="Va">command</var>, <var class="Va">command_args</var>, - <var class="Va">command_interpreter</var>, - <var class="Va">extra_commands</var>, <var class="Va">pidfile</var>, - <var class="Va">rcvar</var>, <var class="Va">required_dirs</var>, - <var class="Va">required_files</var>, <var class="Va">required_vars</var>, - <var class="Ar">argument</var><var class="Va">_cmd</var>, - <var class="Ar">argument</var><var class="Va">_precmd</var>. - <var class="Ar">argument</var><var class="Va">_postcmd</var>.</div> - <p class="Pp">Call <code class="Ic">rc_trace</code> to indicate that - <var class="Ar">file</var> is to be run.</p> - <p class="Pp">However, if <code class="Ic">is_verified</code> - <var class="Ar">file</var> fails, just return.</p> - <p class="Pp"><code class="Ic">DebugOn</code> will be called with tags - derived from <var class="Va">name</var> and <var class="Va">rc_arg</var> - to enable tracing if any of those tags appear in - <var class="Va">DEBUG_SH</var>.</p> - <p class="Pp"><code class="Ic">run_rc_script</code> executes - <var class="Ar">file</var> unless:</p> - <ol class="Bl-enum"> - <li><var class="Ar">file</var> ends in <span class="Pa">.sh</span> and - lives in <span class="Pa">/etc/rc.d</span>.</li> - <li><var class="Ar">file</var> appears to be a backup or scratch file - (e.g., with a suffix of <span class="Pa">~</span>, - <span class="Pa">#</span>, <span class="Pa">.OLD</span>, - <span class="Pa">,v</span>, or <span class="Pa">.orig</span>).</li> - <li><var class="Ar">file</var> is not executable.</li> - </ol> - </dd> - <dt id="run_rc_scripts~2"><a class="permalink" href="#run_rc_scripts~2"><code class="Ic">run_rc_scripts</code></a> - [options] file ...</dt> - <dd>Call <code class="Ic">run_rc_script</code> for each - <var class="Ar">file</var>, unless it is already recorded as having been - run. - <p class="Pp">The <var class="Ar">options</var> are:</p> - <dl class="Bl-tag"> - <dt id="-arg"><a class="permalink" href="#-arg"><code class="Ic">--arg</code></a> - <var class="Ar">arg</var></dt> - <dd>Pass <var class="Ar">arg</var> to - <code class="Ic">run_rc_script</code>, default is - <var class="Ar">_boot</var> set by <a class="Xr">rc(8)</a>.</dd> - <dt id="-break"><a class="permalink" href="#-break"><code class="Ic">--break</code></a> - <var class="Ar">break</var></dt> - <dd>Stop processing if any <var class="Ar">file</var> matches any - <var class="Ar">break</var></dd> - </dl> - </dd> - <dt id="safe_dot~2"><a class="permalink" href="#safe_dot~2"><code class="Ic">safe_dot</code></a> - <var class="Ar">file ...</var></dt> - <dd>Used by <code class="Ic">sdot</code> when - <a class="Xr">mac_veriexec(4)</a> is active and <var class="Ar">file</var> - is not verified. - <p class="Pp">This function limits the input from <var class="Ar">file</var> - to simple variable assignments with any non-alphanumeric characters - replaced with ‘<code class="Li">_</code>’.</p> - </dd> - <dt id="sdot~2"><a class="permalink" href="#sdot~2"><code class="Ic">sdot</code></a> - <var class="Ar">file ...</var></dt> - <dd>For reading in configuration files. Skip files that do not exist or are - empty. Try using <code class="Ic">vdot</code> and if that fails (the file - is unverified) fall back to using <code class="Ic">safe_dot</code>.</dd> - <dt id="startmsg~2"><a class="permalink" href="#startmsg~2"><code class="Ic">startmsg</code></a> - [<code class="Fl">-n</code>] <var class="Ar">message</var></dt> - <dd>Display a start message to <var class="Va">stdout</var>. It should be used - instead of <a class="Xr">echo(1)</a>. The display of this output can be - turned off if the <a class="Xr">rc.conf(5)</a> variable - <var class="Va">rc_startmsgs</var> is set to - “<code class="Li">NO</code>”.</dd> - <dt id="stop_boot"><a class="permalink" href="#stop_boot"><code class="Ic">stop_boot</code></a> - [<var class="Ar">always</var>]</dt> - <dd>Prevent booting to multiuser mode. If the <var class="Va">autoboot</var> - variable is set to ‘<code class="Li">yes</code>’ (see - <a class="Xr">rc(8)</a> to learn more about - <var class="Va">autoboot</var>), or <code class="Ic">checkyesno</code> - <var class="Ar">always</var> indicates a truth value, then a - <code class="Dv">SIGTERM</code> signal is sent to the parent process, - which is assumed to be <a class="Xr">rc(8)</a>. Otherwise, the shell exits - with a non-zero status.</dd> - <dt id="vdot~2"><a class="permalink" href="#vdot~2"><code class="Ic">vdot</code></a> - <var class="Ar">file ...</var></dt> - <dd>For reading in only verified files. - <p class="Pp">Ensure shell <code class="Li">verify</code> option is on. This - option is only meaningful when <a class="Xr">mac_veriexec(4)</a> is - active, otherwise this function is effectively the same as - <code class="Ic">dot</code>.</p> - <p class="Pp">Read in each <var class="Ar">file</var> if it exists and - <code class="Ic">is_verfied</code> <var class="Ar">file</var> is - successful, otherwise set return code to 80 (EAUTH).</p> - <p class="Pp">Restore previous state of the <code class="Li">verify</code> - option.</p> - </dd> - <dt id="wait_for_pids~2"><a class="permalink" href="#wait_for_pids~2"><code class="Ic">wait_for_pids</code></a> - [<var class="Ar">pid ...</var>]</dt> - <dd>Wait until all of the provided <var class="Ar">pids</var> do not exist any - more, printing the list of outstanding <var class="Ar">pids</var> every - two seconds.</dd> - <dt id="warn~2"><a class="permalink" href="#warn~2"><code class="Ic">warn</code></a> - <var class="Ar">message</var></dt> - <dd>Display a warning message to <var class="Va">stderr</var> and log it to - the system log using <a class="Xr">logger(1)</a>. The warning message - consists of the script name (from <var class="Va">$0</var>), followed by - “<code class="Li">: WARNING: </code>”, and then - <var class="Ar">message</var>.</dd> -</dl> -</section> -<section class="Sh"> -<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1> -<dl class="Bl-tag Bl-compact"> - <dt><span class="Pa">/etc/rc.subr</span></dt> - <dd>The <code class="Nm">rc.subr</code> file resides in - <span class="Pa">/etc</span>.</dd> -</dl> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">rc.conf(5)</a>, <a class="Xr">debug.sh(8)</a>, - <a class="Xr">rc(8)</a></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> -<p class="Pp">The <code class="Nm">rc.subr</code> script appeared in - <span class="Ux">NetBSD 1.3</span>. The <a class="Xr">rc.d(8)</a> support - functions appeared in <span class="Ux">NetBSD 1.5</span>. The - <code class="Nm">rc.subr</code> script first appeared in - <span class="Ux">FreeBSD 5.0</span>.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">October 23, 2024</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> diff --git a/static/freebsd/man8/rescue.8 3.html b/static/freebsd/man8/rescue.8 3.html deleted file mode 100644 index 898dc3a7..00000000 --- a/static/freebsd/man8/rescue.8 3.html +++ /dev/null @@ -1,112 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">RESCUE(8)</td> - <td class="head-vol">System Manager's Manual</td> - <td class="head-rtitle">RESCUE(8)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">rescue</code> — <span class="Nd">rescue - utilities in <span class="Pa">/rescue</span></span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">The <span class="Pa">/rescue</span> directory contains a - collection of common utilities intended for use in recovering a badly - damaged system. With the transition to a dynamically-linked root beginning - with <span class="Ux">FreeBSD 5.2</span>, there is a real possibility that - the standard tools in <span class="Pa">/bin</span> and - <span class="Pa">/sbin</span> may become non-functional due to a failed - upgrade or a disk error. The tools in <span class="Pa">/rescue</span> are - statically linked and should therefore be more resistant to damage. However, - being statically linked, the tools in <span class="Pa">/rescue</span> are - also less functional than the standard utilities. In particular, they do not - have full use of the locale, <a class="Xr">pam(3)</a>, and nsswitch - libraries.</p> -<p class="Pp">If your system fails to boot, and it shows a prompt similar - to:</p> -<p class="Pp"></p> -<div class="Bd Bd-indent"><code class="Li">Enter full pathname of shell or - RETURN for /bin/sh: </code></div> -<p class="Pp">the first thing to try running is the standard shell, - <span class="Pa">/bin/sh</span>. If that fails, try running - <span class="Pa">/rescue/sh</span>, which is the - <code class="Nm">rescue</code> shell. To repair the system, the root - partition must first be remounted read-write. This can be done with the - following <a class="Xr">mount(8)</a> command:</p> -<p class="Pp"></p> -<div class="Bd Bd-indent"><code class="Li">/rescue/mount -uw /</code></div> -<p class="Pp">The next step is to double-check the contents of - <span class="Pa">/bin</span>, <span class="Pa">/sbin</span>, and - <span class="Pa">/usr/lib</span>, possibly mounting a - <span class="Ux">FreeBSD</span> rescue or “live file system” - CD-ROM and copying files from there. Once it is possible to successfully run - <span class="Pa">/bin/sh</span>, <span class="Pa">/bin/ls</span>, and other - standard utilities, try rebooting back into the standard system.</p> -<p class="Pp">The <span class="Pa">/rescue</span> tools are compiled using - <a class="Xr">crunchgen(1)</a>, which makes them considerably more compact - than the standard utilities. To build a <span class="Ux">FreeBSD</span> - system where space is critical, <span class="Pa">/rescue</span> can be used - as a replacement for the standard <span class="Pa">/bin</span> and - <span class="Pa">/sbin</span> directories; simply change - <span class="Pa">/bin</span> and <span class="Pa">/sbin</span> to be - symbolic links pointing to <span class="Pa">/rescue</span>. Since - <span class="Pa">/rescue</span> is statically linked, it should also be - possible to dispense with much of <span class="Pa">/usr/lib</span> in such - an environment.</p> -<p class="Pp">In contrast to its predecessor <span class="Pa">/stand</span>, - <span class="Pa">/rescue</span> is updated during normal - <span class="Ux">FreeBSD</span> source and binary upgrades.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1> -<dl class="Bl-tag Bl-compact"> - <dt><span class="Pa">/rescue</span></dt> - <dd>Root of the <code class="Nm">rescue</code> hierarchy.</dd> -</dl> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">crunchgen(1)</a>, <a class="Xr">crash(8)</a></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> -<p class="Pp">The <code class="Nm">rescue</code> utilities first appeared in - <span class="Ux">FreeBSD 5.2</span>.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1> -<p class="Pp">The <code class="Nm">rescue</code> system was written by - <span class="An">Tim Kientzle</span> - <<a class="Mt" href="mailto:kientzle@FreeBSD.org">kientzle@FreeBSD.org</a>>, - based on ideas taken from <span class="Ux">NetBSD</span>. This manual page - was written by <span class="An">Simon L. Nielsen</span> - <<a class="Mt" href="mailto:simon@FreeBSD.org">simon@FreeBSD.org</a>>, - based on text by <span class="An">Tim Kientzle</span> - <<a class="Mt" href="mailto:kientzle@FreeBSD.org">kientzle@FreeBSD.org</a>>.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1> -<p class="Pp">Most of the <code class="Nm">rescue</code> tools work even in a - fairly crippled system. The most egregious exception is the - <code class="Nm">rescue</code> version of <a class="Xr">vi(1)</a>, which - currently requires that <span class="Pa">/usr</span> be mounted so that it - can access the <a class="Xr">termcap(5)</a> files. Hopefully, a failsafe - <a class="Xr">termcap(3)</a> entry will eventually be added into the - <a class="Xr">ncurses(3)</a> library, so that - <span class="Pa">/rescue/vi</span> can be used even in a system where - <span class="Pa">/usr</span> cannot immediately be mounted. In the meantime, - the <code class="Nm">rescue</code> version of the <a class="Xr">ed(1)</a> - editor can be used from <span class="Pa">/rescue/ed</span> if you need to - edit files, but cannot mount <span class="Pa">/usr</span>.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">June 30, 2022</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> diff --git a/static/freebsd/man8/uefi.8 3.html b/static/freebsd/man8/uefi.8 3.html deleted file mode 100644 index 05f980b1..00000000 --- a/static/freebsd/man8/uefi.8 3.html +++ /dev/null @@ -1,132 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">UEFI(8)</td> - <td class="head-vol">System Manager's Manual</td> - <td class="head-rtitle">UEFI(8)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">UEFI</code> — <span class="Nd">Unified - Extensible Firmware Interface bootstrapping procedures</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">The <code class="Nm">UEFI</code> Unified Extensible Firmware - Interface provides boot- and run-time services to operating systems. - <code class="Nm">UEFI</code> is a replacement for the legacy BIOS on the - i386 and amd64 CPU architectures, and is also used on arm, arm64 and riscv - architectures.</p> -<p class="Pp">The UEFI specification is the successor to the Extensible Firmware - Interface (EFI) specification. The terms UEFI and EFI are often used - interchangeably.</p> -<p class="Pp">The <code class="Nm">UEFI</code> boot process loads system - bootstrap code located in an EFI System Partition (ESP). The ESP is a GPT or - MBR partition with a specific identifier that contains an - <a class="Xr">msdosfs(4)</a> FAT file system with a specified file - hierarchy.</p> -<table class="Bl-column Bd-indent"> - <tr id="Partition"> - <td><a class="permalink" href="#Partition"><b class="Sy">Partition - Scheme</b></a></td> - <td><a class="permalink" href="#ESP"><b class="Sy" id="ESP">ESP - Identifier</b></a></td> - </tr> - <tr> - <td>GPT</td> - <td>C12A7328-F81F-11D2-BA4B-00A0C93EC93B</td> - </tr> - <tr> - <td>MBR</td> - <td>0xEF</td> - </tr> -</table> -<p class="Pp">The <code class="Nm">UEFI</code> boot process proceeds as - follows:</p> -<ol class="Bl-enum Bd-indent Bl-compact"> - <li><code class="Nm">UEFI</code> firmware runs at power up and searches for an - OS loader in the EFI system partition. The path to the loader may be set - by an EFI environment variable managed by <a class="Xr">efibootmgr(8)</a>. - If not set, an architecture-specific default is used. - <table class="Bl-column Bd-indent"> - <tr id="Architecture"> - <td><a class="permalink" href="#Architecture"><b class="Sy">Architecture</b></a></td> - <td><a class="permalink" href="#Default"><b class="Sy" id="Default">Default - Path</b></a></td> - </tr> - <tr> - <td>amd64</td> - <td><span class="Pa">/EFI/BOOT/BOOTX64.EFI</span></td> - </tr> - <tr> - <td>arm</td> - <td><span class="Pa">/EFI/BOOT/BOOTARM.EFI</span></td> - </tr> - <tr> - <td>arm64</td> - <td><span class="Pa">/EFI/BOOT/BOOTAA64.EFI</span></td> - </tr> - <tr> - <td>i386</td> - <td><span class="Pa">/EFI/BOOT/BOOTIA32.EFI</span></td> - </tr> - <tr> - <td>riscv</td> - <td><span class="Pa">/EFI/BOOT/BOOTRISCV64.EFI</span></td> - </tr> - </table> - <p class="Pp">The default <code class="Nm">UEFI</code> boot configuration - for <span class="Ux">FreeBSD</span> installs - <span class="Pa">loader.efi</span> in the default path.</p> - </li> - <li><span class="Pa">loader.efi</span> reads boot configuration from - <span class="Pa">/boot.config</span> or - <span class="Pa">/boot/config</span>.</li> - <li><span class="Pa">loader.efi</span> loads and boots the kernel, as - described in <a class="Xr">loader.efi(8)</a>.</li> -</ol> -<p class="Pp">The <a class="Xr">vt(4)</a> system console is automatically - selected when booting via <code class="Nm">UEFI</code>.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1> -<p class="Pp"><code class="Nm">UEFI</code> bootstrap</p> -<dl class="Bl-tag Bl-compact"> - <dt><span class="Pa">/boot/loader.efi</span></dt> - <dd>Final stage bootstrap</dd> - <dt><span class="Pa">/boot/kernel/kernel</span></dt> - <dd>Default kernel</dd> - <dt><span class="Pa">/boot/kernel.old/kernel</span></dt> - <dd>Typical non-default kernel (optional)</dd> -</dl> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">msdosfs(4)</a>, <a class="Xr">vt(4)</a>, - <a class="Xr">boot.config(5)</a>, <a class="Xr">boot(8)</a>, - <a class="Xr">efibootmgr(8)</a>, <a class="Xr">efidp(8)</a>, - <a class="Xr">efivar(8)</a>, <a class="Xr">gpart(8)</a>, - <a class="Xr">loader.efi(8)</a>, <a class="Xr">uefisign(8)</a></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> -<p class="Pp">EFI boot support for the ia64 architecture first appeared in - <span class="Ux">FreeBSD 5.0</span>. <code class="Nm">UEFI</code> boot - support for amd64 first appeared in <span class="Ux">FreeBSD 10.1</span>; - for arm64 in <span class="Ux">FreeBSD 11.0</span>; for armv7 in - <span class="Ux">FreeBSD 12.0</span>; and for riscv in - <span class="Ux">FreeBSD 13.0</span>.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1> -<p class="Pp">There is no support for 32-bit i386 booting via UEFI.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">August 31, 2023</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> diff --git a/static/freebsd/man8/yp.8 3.html b/static/freebsd/man8/yp.8 3.html deleted file mode 100644 index ad1fe51f..00000000 --- a/static/freebsd/man8/yp.8 3.html +++ /dev/null @@ -1,289 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">YP(8)</td> - <td class="head-vol">System Manager's Manual</td> - <td class="head-rtitle">YP(8)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">yp</code> — <span class="Nd">description - of the YP/NIS system</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> -<table class="Nm"> - <tr> - <td><code class="Nm">yp</code></td> - <td></td> - </tr> -</table> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">The <code class="Nm">YP</code> subsystem allows network management - of passwd, group, netgroup, hosts, services, rpc, bootparams and ethers file - entries through the functions <a class="Xr">getpwent(3)</a>, - <a class="Xr">getgrent(3)</a>, <a class="Xr">getnetgrent(3)</a>, - <a class="Xr">gethostent(3)</a>, <a class="Xr">getnetent(3)</a>, - <a class="Xr">getrpcent(3)</a>, and <a class="Xr">ethers(3)</a>. The - <a class="Xr">bootparamd(8)</a> daemon makes direct NIS library calls since - there are no functions in the standard C library for reading bootparams. NIS - support is enabled in <a class="Xr">nsswitch.conf(5)</a>.</p> -<p class="Pp">The <code class="Nm">YP</code> subsystem is started automatically - in <span class="Pa">/etc/rc</span> if it has been initialized in - <span class="Pa">/etc/rc.conf</span> and if the directory - <span class="Pa">/var/yp</span> exists (which it does in the default - distribution). The default NIS domain must also be set with the - <a class="Xr">domainname(1)</a> command, which will happen automatically at - system startup if it is specified in - <span class="Pa">/etc/rc.conf</span>.</p> -<p class="Pp">NIS is an RPC-based client/server system that allows a group of - machines within an NIS domain to share a common set of configuration files. - This permits a system administrator to set up NIS client systems with only - minimal configuration data and add, remove or modify configuration data from - a single location.</p> -<p class="Pp" id="master">The canonical copies of all NIS information are stored - on a single machine called the NIS - <a class="permalink" href="#master"><i class="Em">master server</i></a>. The - databases used to store the information are called NIS - <a class="permalink" href="#maps"><i class="Em" id="maps">maps</i></a>. In - <span class="Ux">FreeBSD</span>, these maps are stored in - <span class="Pa">/var/yp/</span>⟨<var class="Ar">domainname</var>⟩ - where ⟨<var class="Ar">domainname</var>⟩ is the name of the - NIS domain being served. A single NIS server can support several domains at - once, therefore it is possible to have several such directories, one for - each supported domain. Each domain will have its own independent set of - maps.</p> -<p class="Pp">In <span class="Ux">FreeBSD</span>, the NIS maps are Berkeley DB - hashed database files (the same format used for the - <a class="Xr">passwd(5)</a> database files). Other operating systems that - support NIS use old-style <code class="Nm">ndbm</code> databases instead - (largely because Sun Microsystems originally based their NIS implementation - on <code class="Nm">ndbm</code>, and other vendors have simply licensed - Sun's code rather than design their own implementation with a different - database format). On these systems, the databases are generally split into - <span class="Pa">.dir</span> and <span class="Pa">.pag</span> files which - the <code class="Nm">ndbm</code> code uses to hold separate parts of the - hash database. The Berkeley DB hash method instead uses a single file for - both pieces of information. This means that while you may have - <span class="Pa">passwd.byname.dir</span> and - <span class="Pa">passwd.byname.pag</span> files on other operating systems - (both of which are really parts of the same map), - <span class="Ux">FreeBSD</span> will have only one file called - <span class="Pa">passwd.byname</span>. The difference in format is not - significant: only the NIS server, <a class="Xr">ypserv(8)</a>, and related - tools need to know the database format of the NIS maps. Client NIS systems - receive all NIS data in ASCII form.</p> -<p class="Pp">There are three main types of NIS systems:</p> -<ol class="Bl-enum"> - <li>NIS clients, which query NIS servers for information.</li> - <li>NIS master servers, which maintain the canonical copies of all NIS - maps.</li> - <li>NIS slave servers, which maintain backup copies of NIS maps that are - periodically updated by the master.</li> -</ol> -<p class="Pp" id="binding">A NIS client establishes what is called a - <a class="permalink" href="#binding"><i class="Em">binding</i></a> to a - particular NIS server using the <a class="Xr">ypbind(8)</a> daemon. The - <a class="Xr">ypbind(8)</a> utility checks the system's default domain (as - set by the <a class="Xr">domainname(1)</a> command) and begins broadcasting - RPC requests on the local network. These requests specify the name of the - domain for which <a class="Xr">ypbind(8)</a> is attempting to establish a - binding. If a server that has been configured to serve the requested domain - receives one of the broadcasts, it will respond to - <a class="Xr">ypbind(8)</a>, which will record the server's address. If - there are several servers available (a master and several slaves, for - example), <a class="Xr">ypbind(8)</a> will use the address of the first one - to respond. From that point on, the client system will direct all of its NIS - requests to that server. The <a class="Xr">ypbind(8)</a> utility will - occasionally “ping” the server to make sure it is still up and - running. If it fails to receive a reply to one of its pings within a - reasonable amount of time, <a class="Xr">ypbind(8)</a> will mark the domain - as unbound and begin broadcasting again in the hopes of locating another - server.</p> -<p class="Pp">NIS master and slave servers handle all NIS requests with the - <a class="Xr">ypserv(8)</a> daemon. The <a class="Xr">ypserv(8)</a> utility - is responsible for receiving incoming requests from NIS clients, translating - the requested domain and map name to a path to the corresponding database - file and transmitting data from the database back to the client. There is a - specific set of requests that <a class="Xr">ypserv(8)</a> is designed to - handle, most of which are implemented as functions within the standard C - library:</p> -<dl class="Bl-tag"> - <dt id="yp_order"><a class="permalink" href="#yp_order"><code class="Fn">yp_order</code></a>()</dt> - <dd>check the creation date of a particular map</dd> - <dt id="yp_master"><a class="permalink" href="#yp_master"><code class="Fn">yp_master</code></a>()</dt> - <dd>obtain the name of the NIS master server for a given map/domain</dd> - <dt id="yp_match"><a class="permalink" href="#yp_match"><code class="Fn">yp_match</code></a>()</dt> - <dd>lookup the data corresponding to a given in key in a particular - map/domain</dd> - <dt id="yp_first"><a class="permalink" href="#yp_first"><code class="Fn">yp_first</code></a>()</dt> - <dd>obtain the first key/data pair in a particular map/domain</dd> - <dt id="yp_next"><a class="permalink" href="#yp_next"><code class="Fn">yp_next</code></a>()</dt> - <dd>pass <a class="Xr">ypserv(8)</a> a key in a particular map/domain and have - it return the key/data pair immediately following it (the functions - <code class="Fn">yp_first</code>() and <code class="Fn">yp_next</code>() - can be used to do a sequential search of an NIS map)</dd> - <dt id="yp_all"><a class="permalink" href="#yp_all"><code class="Fn">yp_all</code></a>()</dt> - <dd>retrieve the entire contents of a map</dd> -</dl> -<p class="Pp">There are a few other requests which <a class="Xr">ypserv(8)</a> - is capable of handling (i.e., acknowledge whether or not you can handle a - particular domain (<code class="Dv">YPPROC_DOMAIN</code>), or acknowledge - only if you can handle the domain and be silent otherwise - (<code class="Dv">YPPROC_DOMAIN_NONACK</code>)) but these requests are - usually generated only by <a class="Xr">ypbind(8)</a> and are not meant to - be used by standard utilities.</p> -<p class="Pp">On networks with a large number of hosts, it is often a good idea - to use a master server and several slaves rather than just a single master - server. A slave server provides the exact same information as a master - server: whenever the maps on the master server are updated, the new data - should be propagated to the slave systems using the - <a class="Xr">yppush(8)</a> command. The NIS - <span class="Pa">Makefile</span> (<span class="Pa">/var/yp/Makefile</span>) - will do this automatically if the administrator creates - <span class="Pa">/var/yp/Makefile.local</span> and empties the - <var class="Va">NOPUSH</var> variable:</p> -<div class="Bd Pp Bd-indent Li"> -<pre><code class="Li">NOPUSH=</code></pre> -</div> -<p class="Pp">(<var class="Va">NOPUSH</var> is set to true by default because - the default configuration is for a small network with only one NIS server). - The <a class="Xr">yppush(8)</a> command will initiate a transaction between - the master and slave during which the slave will transfer the specified maps - from the master server using <a class="Xr">ypxfr(8)</a>. (The slave server - calls <a class="Xr">ypxfr(8)</a> automatically from within - <a class="Xr">ypserv(8)</a>; therefore it is not usually necessary for the - administrator to use it directly. It can be run manually if desired, - however.) Maintaining slave servers helps improve NIS performance on large - networks by:</p> -<ul class="Bl-bullet"> - <li>Providing backup services in the event that the NIS master crashes or - becomes unreachable</li> - <li>Spreading the client load out over several machines instead of causing the - master to become overloaded</li> - <li>Allowing a single NIS domain to extend beyond a local network (the - <a class="Xr">ypbind(8)</a> daemon might not be able to locate a server - automatically if it resides on a network outside the reach of its - broadcasts. It is possible to force <a class="Xr">ypbind(8)</a> to bind to - a particular server with <a class="Xr">ypset(8)</a> but this is sometimes - inconvenient. This problem can be avoided simply by placing a slave server - on the local network.)</li> -</ul> -<p class="Pp" id="shadow">The <span class="Ux">FreeBSD</span> - <a class="Xr">ypserv(8)</a> is specially designed to provide enhanced - security (compared to other NIS implementations) when used exclusively with - <span class="Ux">FreeBSD</span> client systems. The - <span class="Ux">FreeBSD</span> password database system (which is derived - directly from <span class="Ux">4.4BSD</span>) includes support for - <a class="permalink" href="#shadow"><i class="Em">shadow passwords</i></a>. - The standard password database does not contain users' encrypted passwords: - these are instead stored (along with other information) in a separate - database which is accessible only by the super-user. If the encrypted - password database were made available as an NIS map, this security feature - would be totally disabled, since any user is allowed to retrieve NIS - data.</p> -<p class="Pp">To help prevent this, <span class="Ux">FreeBSD</span>'s NIS server - handles the shadow password maps - (<span class="Pa">master.passwd.byname</span>, - <span class="Pa">master.passwd.byuid</span>, - <span class="Pa">shadow.byname</span> and - <span class="Pa">shadow.byuid</span>) in a special way: the server will only - provide access to these maps in response to requests that originate on - privileged ports. Since only the super-user is allowed to bind to a - privileged port, the server assumes that all such requests come from - privileged users. All other requests are denied: requests from - non-privileged ports will receive only an error code from the server. - Additionally, <span class="Ux">FreeBSD</span>'s <a class="Xr">ypserv(8)</a> - includes support for <span class="An">Wietse Venema</span>'s tcp wrapper - package; with tcp wrapper support enabled, the administrator can configure - <a class="Xr">ypserv(8)</a> to respond only to selected client machines.</p> -<p class="Pp">While these enhancements provide better security than stock NIS, - they are by no means 100% effective. It is still possible for someone with - access to your network to spoof the server into disclosing the shadow - password maps.</p> -<p class="Pp">On the client side, <span class="Ux">FreeBSD</span>'s - <a class="Xr">getpwent(3)</a> functions will automatically search for the - <span class="Pa">master.passwd</span> maps and use them if they exist. If - they do, they will be used, and all fields in these special maps (class, - password age and account expiration) will be decoded. If they are not found, - the standard <span class="Pa">passwd</span> maps will be used instead.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="COMPATIBILITY"><a class="permalink" href="#COMPATIBILITY">COMPATIBILITY</a></h1> -<p class="Pp">When using a - <span class="No">non-</span><span class="Ux">FreeBSD</span> NIS server for - <a class="Xr">passwd(5)</a> files, it is unlikely that the default MD5-based - format that <span class="Ux">FreeBSD</span> uses for passwords will be - accepted by it. If this is the case, the value of the - <var class="Va">passwd_format</var> setting in - <a class="Xr">login.conf(5)</a> should be changed to - "<code class="Li">des</code>" for compatibility.</p> -<p class="Pp">Some systems, such as SunOS 4.x, need NIS to be running in order - for their hostname resolution functions - (<code class="Fn">gethostbyname</code>(), - <code class="Fn">gethostbyaddr</code>(), etc.) to work properly. On these - systems, <a class="Xr">ypserv(8)</a> performs DNS lookups when asked to - return information about a host that does not exist in its - <span class="Pa">hosts.byname</span> or <span class="Pa">hosts.byaddr</span> - maps. <span class="Ux">FreeBSD</span>'s resolver uses DNS by default (it can - be made to use NIS, if desired), therefore its NIS server does not do DNS - lookups by default. However, <a class="Xr">ypserv(8)</a> can be made to - perform DNS lookups if it is started with a special flag. It can also be - made to register itself as an NIS v1 server in order to placate certain - systems that insist on the presence of a v1 server - (<span class="Ux">FreeBSD</span> uses only NIS v2, but many other systems, - including SunOS 4.x, search for both a v1 and v2 server when binding). - <span class="Ux">FreeBSD</span>'s <a class="Xr">ypserv(8)</a> does not - actually handle NIS v1 requests, but this “kludge mode” is - useful for silencing stubborn systems that search for both a v1 and v2 - server.</p> -<p class="Pp">(Please see the <a class="Xr">ypserv(8)</a> manual page for a - detailed description of these special features and flags.)</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">domainname(1)</a>, <a class="Xr">ypcat(1)</a>, - <a class="Xr">ypmatch(1)</a>, <a class="Xr">ypwhich(1)</a>, - <a class="Xr">nsswitch.conf(5)</a>, <a class="Xr">yp_mkdb(8)</a>, - <a class="Xr">ypbind(8)</a>, <a class="Xr">ypinit(8)</a>, - <a class="Xr">yppoll(8)</a>, <a class="Xr">yppush(8)</a>, - <a class="Xr">ypserv(8)</a>, <a class="Xr">ypset(8)</a>, - <a class="Xr">ypxfr(8)</a></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> -<p class="Pp">The <code class="Nm">YP</code> subsystem was written from the - ground up by <span class="An">Theo de Raadt</span> to be compatible to Sun's - implementation. Bug fixes, improvements and NIS server support were later - added by <span class="An">Bill Paul</span>. The server-side code was - originally written by <span class="An">Peter Eriksson</span> and - <span class="An">Tobias Reber</span> and is subject to the GNU Public - License. No Sun code was referenced.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1> -<p class="Pp">While <span class="Ux">FreeBSD</span> now has both NIS client and - server capabilities, it does not yet have support for - <a class="Xr">ypupdated(8)</a> or the <code class="Fn">yp_update</code>() - function. Both of these require secure RPC, which - <span class="Ux">FreeBSD</span> does not support yet either.</p> -<p class="Pp">The <a class="Xr">getservent(3)</a> and - <a class="Xr">getprotoent(3)</a> functions do not yet have NIS support. - Fortunately, these files do not need to be updated that often.</p> -<p class="Pp">Many more manual pages should be written, especially - <a class="Xr">ypclnt(3)</a>. For the time being, seek out a local Sun - machine and read the manuals for there.</p> -<p class="Pp">Neither Sun nor this author have found a clean way to handle the - problems that occur when ypbind cannot find its server upon bootup.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">December 14, 2011</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> |
