bootscripts.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-scripts-bootscripts" role="wrap" revision="sysv">
  8. <?dbhtml filename="bootscripts.html"?>
  9. <sect1info condition="script">
  10. <productname>lfs-bootscripts</productname>
  11. <productnumber>&lfs-bootscripts-version;</productnumber>
  12. <address>&lfs-bootscripts-url;</address>
  13. </sect1info>
  14. <title>LFS-Bootscripts-&lfs-bootscripts-version;</title>
  15. <indexterm zone="ch-scripts-bootscripts">
  16. <primary sortas="a-Bootscripts">Bootscripts</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>LFS-Bootscripts 软件包包含一组在引导和关机过程中,
  21. 启动和停止 LFS 系统的脚本。
  22. 它们的配置文件和自定义引导过程的方法将在后续章节中描述。</para>
  23. <segmentedlist>
  24. <segtitle>&buildtime;</segtitle>
  25. <segtitle>&diskspace;</segtitle>
  26. <seglistitem>
  27. <seg>&lfs-bootscripts-ch7-sbu;</seg>
  28. <seg>&lfs-bootscripts-ch7-du;</seg>
  29. </seglistitem>
  30. </segmentedlist>
  31. </sect2>
  32. <sect2 role="installation">
  33. <title>安装 LFS-Bootscripts</title>
  34. <para>安装该软件包:</para>
  35. <screen><userinput remap="install">make install</userinput></screen>
  36. </sect2>
  37. <sect2 id="contents-bootscripts" role="content">
  38. <title>LFS-Bootscripts 的内容</title>
  39. <segmentedlist>
  40. <segtitle>安装的脚本</segtitle>
  41. <segtitle>安装的目录</segtitle>
  42. <seglistitem>
  43. <seg>checkfs, cleanfs, console, functions, halt, ifdown,
  44. ifup, localnet, modules, mountfs, mountvirtfs, network, rc, reboot,
  45. sendsignals, setclock, ipv4-static, swap, sysctl, sysklogd, template,
  46. udev, 以及 udev_retry</seg>
  47. <seg>/etc/rc.d, /etc/init.d (符号链接), /etc/sysconfig,
  48. /lib/services, /lib/lsb (符号链接)</seg>
  49. </seglistitem>
  50. </segmentedlist>
  51. <variablelist>
  52. <bridgehead renderas="sect3">简要描述</bridgehead>
  53. <?dbfo list-presentation="list"?>
  54. <?dbhtml list-presentation="table"?>
  55. <varlistentry id="checkfs-bootscripts">
  56. <term><command>checkfs</command></term>
  57. <listitem>
  58. <para>在挂载文件系统前检查文件系统完整性
  59. (日志文件系统和网络文件系统除外)</para>
  60. <indexterm zone="ch-scripts-bootscripts checkfs-bootscripts">
  61. <primary sortas="d-checkfs">checkfs</primary>
  62. </indexterm>
  63. </listitem>
  64. </varlistentry>
  65. <varlistentry id="cleanfs-bootscripts">
  66. <term><command>cleanfs</command></term>
  67. <listitem>
  68. <para>删除在重启过程中不应保留的文件,例如
  69. <filename class="directory">/var/run/</filename> 和
  70. <filename class="directory">/var/lock/</filename> 中的文件;
  71. 重新创建
  72. <filename>/var/run/utmp</filename> 并删除可能存在的
  73. <filename>/etc/nologin</filename>, <filename>/fastboot</filename>,
  74. 以及 <filename>/forcefsck</filename> 文件</para>
  75. <indexterm zone="ch-scripts-bootscripts cleanfs-bootscripts">
  76. <primary sortas="d-cleanfs">cleanfs</primary>
  77. </indexterm>
  78. </listitem>
  79. </varlistentry>
  80. <varlistentry id="console-bootscripts">
  81. <term><command>console</command></term>
  82. <listitem>
  83. <para>加载用户希望使用的键盘布局对应的键映射表,
  84. 并加载屏幕字体</para>
  85. <indexterm zone="ch-scripts-bootscripts console-bootscripts">
  86. <primary sortas="d-console">console</primary>
  87. </indexterm>
  88. </listitem>
  89. </varlistentry>
  90. <varlistentry id="functions-bootscripts">
  91. <term><command>functions</command></term>
  92. <listitem>
  93. <para>包含若干启动脚本使用的错误处理和状态检查等脚本</para>
  94. <indexterm zone="ch-scripts-bootscripts functions-bootscripts">
  95. <primary sortas="d-functions">functions</primary>
  96. </indexterm>
  97. </listitem>
  98. </varlistentry>
  99. <varlistentry id="halt-bootscripts">
  100. <term><command>halt</command></term>
  101. <listitem>
  102. <para>停止系统运行</para>
  103. <indexterm zone="ch-scripts-bootscripts halt-bootscripts">
  104. <primary sortas="d-halt">halt</primary>
  105. </indexterm>
  106. </listitem>
  107. </varlistentry>
  108. <varlistentry id="ifdown-bootscripts">
  109. <term><command>ifdown</command></term>
  110. <listitem>
  111. <para>停用网络设备</para>
  112. <indexterm zone="ch-scripts-bootscripts ifdown-bootscripts">
  113. <primary sortas="d-ifdown">ifdown</primary>
  114. </indexterm>
  115. </listitem>
  116. </varlistentry>
  117. <varlistentry id="ifup-bootscripts">
  118. <term><command>ifup</command></term>
  119. <listitem>
  120. <para>启用网络设备</para>
  121. <indexterm zone="ch-scripts-bootscripts ifup-bootscripts">
  122. <primary sortas="d-ifup">ifup</primary>
  123. </indexterm>
  124. </listitem>
  125. </varlistentry>
  126. <varlistentry id="localnet-bootscripts">
  127. <term><command>localnet</command></term>
  128. <listitem>
  129. <para>设置系统主机名和本地回环设备</para>
  130. <indexterm zone="ch-scripts-bootscripts localnet-bootscripts">
  131. <primary sortas="d-localnet">localnet</primary>
  132. </indexterm>
  133. </listitem>
  134. </varlistentry>
  135. <varlistentry id="modules-bootscripts">
  136. <term><command>modules</command></term>
  137. <listitem>
  138. <para>加载
  139. <filename>/etc/sysconfig/modules</filename> 中指定的模块,
  140. 并在加载过程中使用该文件中给定的参数</para>
  141. <indexterm zone="ch-scripts-bootscripts modules-bootscripts">
  142. <primary sortas="d-modules">modules</primary>
  143. </indexterm>
  144. </listitem>
  145. </varlistentry>
  146. <varlistentry id="mountfs-bootscripts">
  147. <term><command>mountfs</command></term>
  148. <listitem>
  149. <para>挂载所有文件系统,标为
  150. <emphasis>noauto</emphasis> 的文件系统和网络文件系统除外</para>
  151. <indexterm zone="ch-scripts-bootscripts mountfs-bootscripts">
  152. <primary sortas="d-mountfs">mountfs</primary>
  153. </indexterm>
  154. </listitem>
  155. </varlistentry>
  156. <varlistentry id="mountvirtfs-bootscripts">
  157. <term><command>mountvirtfs</command></term>
  158. <listitem>
  159. <para>挂载 <systemitem
  160. class="filesystem">proc</systemitem> 等虚拟内核文件系统</para>
  161. <indexterm zone="ch-scripts-bootscripts mountvirtfs-bootscripts">
  162. <primary sortas="d-mountvirtfs">mountvirtfs</primary>
  163. </indexterm>
  164. </listitem>
  165. </varlistentry>
  166. <varlistentry id="network-bootscripts">
  167. <term><command>network</command></term>
  168. <listitem>
  169. <para>设定网卡等网络接口,并(在可能的情况下)设定默认网关</para>
  170. <indexterm zone="ch-scripts-bootscripts network-bootscripts">
  171. <primary sortas="d-network">network</primary>
  172. </indexterm>
  173. </listitem>
  174. </varlistentry>
  175. <varlistentry id="rc-bootscripts">
  176. <term><command>rc</command></term>
  177. <listitem>
  178. <para>主要运行级别控制脚本;
  179. 它负责逐个运行所有其他脚本,
  180. 运行的顺序根据脚本符号链接的名称确定</para>
  181. <indexterm zone="ch-scripts-bootscripts rc-bootscripts">
  182. <primary sortas="d-rc">rc</primary>
  183. </indexterm>
  184. </listitem>
  185. </varlistentry>
  186. <varlistentry id="reboot-bootscripts">
  187. <term><command>reboot</command></term>
  188. <listitem>
  189. <para>重启系统</para>
  190. <indexterm zone="ch-scripts-bootscripts reboot-bootscripts">
  191. <primary sortas="d-reboot">reboot</primary>
  192. </indexterm>
  193. </listitem>
  194. </varlistentry>
  195. <varlistentry id="sendsignals-bootscripts">
  196. <term><command>sendsignals</command></term>
  197. <listitem>
  198. <para>确认在系统重启或停止运行前,所有进程已经终止</para>
  199. <indexterm zone="ch-scripts-bootscripts sendsignals-bootscripts">
  200. <primary sortas="d-sendsignals">sendsignals</primary>
  201. </indexterm>
  202. </listitem>
  203. </varlistentry>
  204. <varlistentry id="setclock-bootscripts">
  205. <term><command>setclock</command></term>
  206. <listitem>
  207. <para>在硬件时钟没有设定为 UTC 时,将内核时钟重设为本地时间</para>
  208. <indexterm zone="ch-scripts-bootscripts setclock-bootscripts">
  209. <primary sortas="d-setclock">setclock</primary>
  210. </indexterm>
  211. </listitem>
  212. </varlistentry>
  213. <varlistentry id="ipv4-static-bootscripts">
  214. <term><command>ipv4-static</command></term>
  215. <listitem>
  216. <para>提供为网络接口分配静态网际互联协议(IP)地址的功能</para>
  217. <indexterm zone="ch-scripts-bootscripts ipv4-static-bootscripts">
  218. <primary sortas="d-ipv4-static">ipv4-static</primary>
  219. </indexterm>
  220. </listitem>
  221. </varlistentry>
  222. <varlistentry id="swap-bootscripts">
  223. <term><command>swap</command></term>
  224. <listitem>
  225. <para>启用或禁用交换空间</para>
  226. <indexterm zone="ch-scripts-bootscripts swap-bootscripts">
  227. <primary sortas="d-swap">swap</primary>
  228. </indexterm>
  229. </listitem>
  230. </varlistentry>
  231. <varlistentry id="sysctl-bootscripts">
  232. <term><command>sysctl</command></term>
  233. <listitem>
  234. <para>如果
  235. <filename>/etc/sysctl.conf</filename> 存在,
  236. 将其中的系统配置选项值加载到内核</para>
  237. <indexterm zone="ch-scripts-bootscripts sysctl-bootscripts">
  238. <primary sortas="d-sysctl">sysctl</primary>
  239. </indexterm>
  240. </listitem>
  241. </varlistentry>
  242. <varlistentry id="sysklogd-bootscripts">
  243. <term><command>sysklogd</command></term>
  244. <listitem>
  245. <para>启动或停止系统与内核日志守护进程</para>
  246. <indexterm zone="ch-scripts-bootscripts sysklogd-bootscripts">
  247. <primary sortas="d-sysklogd">sysklogd</primary>
  248. </indexterm>
  249. </listitem>
  250. </varlistentry>
  251. <varlistentry id="template-bootscripts">
  252. <term><command>template</command></term>
  253. <listitem>
  254. <para>为其他守护进程创建自定义启动脚本的模板</para>
  255. <indexterm zone="ch-scripts-bootscripts template-bootscripts">
  256. <primary sortas="d-template">template</primary>
  257. </indexterm>
  258. </listitem>
  259. </varlistentry>
  260. <varlistentry id="udev-bootscripts">
  261. <term><command>udev</command></term>
  262. <listitem>
  263. <para>准备 <filename class="directory">/dev</filename>
  264. 目录,并启动 udev</para>
  265. <indexterm zone="ch-scripts-bootscripts udev-bootscripts">
  266. <primary sortas="d-udev">udev</primary>
  267. </indexterm>
  268. </listitem>
  269. </varlistentry>
  270. <varlistentry id="udev-retry-bootscripts">
  271. <term><command>udev_retry</command></term>
  272. <listitem>
  273. <para>重试失败的 udev 事件,如果必要的话,将生成的规则从
  274. <filename class="directory">/run/udev</filename> 拷贝到
  275. <filename class="directory">/etc/udev/rules.d</filename></para>
  276. <indexterm zone="ch-scripts-bootscripts udev-retry-bootscripts">
  277. <primary sortas="d-udev-retry">udev_retry</primary>
  278. </indexterm>
  279. </listitem>
  280. </varlistentry>
  281. </variablelist>
  282. </sect2>
  283. </sect1>