⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 boot-init.html

📁 这是很好的学习嵌入式LINUX的文章
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>Init: Process Control Initialization</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD Handbook" href="index.html" /><link rel="UP" title="The FreeBSD Booting Process" href="boot.html" /><link rel="PREVIOUS" title="Device Hints" href="device-hints.html" /><link rel="NEXT" title="Shutdown Sequence" href="boot-shutdown.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD Handbook</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="device-hints.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 12 The FreeBSD BootingProcess</td><td width="10%" align="right" valign="bottom"><a href="boot-shutdown.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="BOOT-INIT" name="BOOT-INIT">12.6 Init: Process ControlInitialization</a></h1><p>Once the kernel has finished booting, it passes control to the user process <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=init&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">init</span>(8)</span></a>, which islocated at <tt class="FILENAME">/sbin/init</tt>, or the program path specified in the <ttclass="ENVAR">init_path</tt> variable in <tt class="COMMAND">loader</tt>.</p><div class="SECT2"><h2 class="SECT2"><a id="BOOT-AUTOREBOOT" name="BOOT-AUTOREBOOT">12.6.1 Automatic RebootSequence</a></h2><p>The automatic reboot sequence makes sure that the file systems available on the systemare consistent. If they are not, and <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=fsck&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">fsck</span>(8)</span></a> cannot fix theinconsistencies, <a href="http://www.FreeBSD.org/cgi/man.cgi?query=init&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">init</span>(8)</span></a> drops thesystem into <a href="boot-init.html#BOOT-SINGLEUSER">single-user mode</a> for the systemadministrator to take care of the problems directly.</p></div><div class="SECT2"><h2 class="SECT2"><a id="BOOT-SINGLEUSER" name="BOOT-SINGLEUSER">12.6.2 Single-UserMode</a></h2><p>This mode can be reached through the <ahref="boot-init.html#BOOT-AUTOREBOOT">automatic reboot sequence</a>, or by the userbooting with the <var class="OPTION">-s</var> option or setting the <ttclass="ENVAR">boot_single</tt> variable in <tt class="COMMAND">loader</tt>.</p><p>It can also be reached by calling <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=shutdown&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">shutdown</span>(8)</span></a> withoutthe reboot (<var class="OPTION">-r</var>) or halt (<var class="OPTION">-h</var>) options,from <a href="boot-init.html#BOOT-MULTIUSER">multi-user mode</a>.</p><p>If the system <var class="LITERAL">console</var> is set to <varclass="LITERAL">insecure</var> in <tt class="FILENAME">/etc/ttys</tt>, then the systemprompts for the <tt class="USERNAME">root</tt> password before initiating single-usermode.</p><div class="EXAMPLE"><a id="BOOT-INSECURE-CONSOLE" name="BOOT-INSECURE-CONSOLE"></a><p><b>Example 12-3. An Insecure Console in <tt class="FILENAME">/etc/ttys</tt></b></p><pre class="PROGRAMLISTING"># name  getty                           type    status          comments## If console is marked "insecure", then init will ask for the root password# when going to single-user mode.console none                            unknown off insecure</pre></div><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> An <var class="LITERAL">insecure</var> console means that you consideryour physical security to the console to be insecure, and want to make sure only someonewho knows the <tt class="USERNAME">root</tt> password may use single-user mode, and itdoes not mean that you want to run your console insecurely. Thus, if you want security,choose <var class="LITERAL">insecure</var>, not <var class="LITERAL">secure</var>.</p></blockquote></div></div><div class="SECT2"><h2 class="SECT2"><a id="BOOT-MULTIUSER" name="BOOT-MULTIUSER">12.6.3 Multi-UserMode</a></h2><p>If <a href="http://www.FreeBSD.org/cgi/man.cgi?query=init&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">init</span>(8)</span></a> finds yourfile systems to be in order, or once the user has finished in <ahref="boot-init.html#BOOT-SINGLEUSER">single-user mode</a>, the system enters multi-usermode, in which it starts the resource configuration of the system.</p><div class="SECT3"><h3 class="SECT3"><a id="BOOT-RC" name="BOOT-RC">12.6.3.1 Resource Configuration(rc)</a></h3><p>The resource configuration system reads in configuration defaults from <ttclass="FILENAME">/etc/defaults/rc.conf</tt>, and system-specific details from <ttclass="FILENAME">/etc/rc.conf</tt>, and then proceeds to mount the system file systemsmentioned in <tt class="FILENAME">/etc/fstab</tt>, start up networking services, start upmiscellaneous system daemons, and finally runs the startup scripts of locally installedpackages.</p><p>The <a href="http://www.FreeBSD.org/cgi/man.cgi?query=rc&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">rc</span>(8)</span></a> manual page is agood reference to the resource configuration system, as is examining the scriptsthemselves.</p></div></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="device-hints.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="boot-shutdown.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Device Hints</td><td width="34%" align="center" valign="top"><a href="boot.html" accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Shutdown Sequence</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting &#60;<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>&#62;.<br />For questions about this documentation, e-mail &#60;<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>&#62;.</small></p></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -