msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2020-06-17 12:44+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Translate Toolkit 2.2.5\n" #. type: Content of: #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:12 msgid "System V Bootscript Usage and Configuration" msgstr "System V 引导脚本使用与配置" #. type: Content of: <sect1><indexterm><primary> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:15 msgid "Bootscripts" msgstr "Bootscripts" #. type: Content of: <sect1><indexterm><secondary> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:16 msgid "usage" msgstr "usage" #. type: Content of: <sect1><sect2><title> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:20 msgid "How Do the System V Bootscripts Work?" msgstr "System V 引导脚本如何工作?" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:22 msgid "" "Linux uses a special booting facility named SysVinit that is based on a " "concept of <emphasis>run-levels</emphasis>. It can be quite different from " "one system to another, so it cannot be assumed that because things worked in " "one particular Linux distribution, they should work the same in LFS too. LFS " "has its own way of doing things, but it respects generally accepted " "standards." msgstr "" "Linux 使用一种称为 SysVinit 的特殊引导架构,它基于<emphasis>运行级别</" "emphasis> (run-level) 的概念而构建。不同系统的 SysVinit 可能会区别很大,因此" "不能假设那些在某个 Linux 发行版上正常工作的方法也能在 LFS 正常工作。LFS 有一" "些独特的工作方式,但它也遵守被广泛接受的标准。" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:28 msgid "" "SysVinit (which will be referred to as <quote>init</quote> from now on) " "works using a run-levels scheme. There are seven (numbered 0 to 6) run-" "levels (actually, there are more run-levels, but they are for special cases " "and are generally not used. See <filename>init(8)</filename> for more " "details), and each one of those corresponds to the actions the computer is " "supposed to perform when it starts up. The default run-level is 3. Here are " "the descriptions of the different run-levels as they are implemented:" msgstr "" "SysVinit (之后简称为<quote>init</quote>) 使用运行级别架构工作。有七个 (编号" "为 0 到 6) 运行级别 (实际上还有更多,但它们用于一些特殊情况,一般并不使用。参" "阅 <filename>init(8)</filename> 了解更多细节),每个都对应于计算机在启动时应该" "进行的一组操作。默认运行级别是 3,下面是不同运行级别的描述:" #. type: Content of: <sect1><sect2><literallayout> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:36 #, no-wrap msgid "" "0: halt the computer\n" "1: single-user mode\n" "2: multi-user mode without networking\n" "3: multi-user mode with networking\n" "4: reserved for customization, otherwise does the same as 3\n" "5: same as 4, it is usually used for GUI login (like X's <command>xdm</command> or KDE's <command>kdm</command>)\n" "6: reboot the computer" msgstr "" "0:停止系统运行\n" "1:单用户模式\n" "2:没有网络连接的多用户模式\n" "3:有网络连接的多用户模式\n" "4:保留用于自定义,如果没有自定义和 3 相同\n" "5:和 4 相同,一般用于 GUI 登录 (如 X 的 <command>xdm</command>) 或 KDE 的 <command>kdm</command>\n" "6:重启计算机" #. type: Content of: <sect1><sect2><title> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:47 msgid "Configuring Sysvinit" msgstr "配置 Sysvinit" #. type: Content of: <sect1><sect2><indexterm><primary> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:50 msgid "Sysvinit" msgstr "Sysvinit" #. type: Content of: <sect1><sect2><indexterm><secondary> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:51 #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:245 #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:307 #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:541 #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:557 msgid "configuring" msgstr "配置" #. type: Content of: <sect1><sect2><indexterm><primary> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:55 msgid "/etc/inittab" msgstr "/etc/inittab" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:58 msgid "" "During the kernel initialization, the first program that is run is either " "specified on the command line or, by default <command>init</command>. This " "program reads the initialization file <filename>/etc/inittab</filename>. " "Create this file with:" msgstr "" "在内核初始化过程中,如果内核命令行中指定了程序,则会首先运行它,否则默认首先" "运行 <command>init</command>。这个程序读取初始化文件 <filename>/etc/inittab</" "filename>。执行以下命令创建该文件:" #. type: Content of: <sect1><sect2><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:63 #, no-wrap msgid "" "<userinput>cat > /etc/inittab << \"EOF\"\n" "<literal># Begin /etc/inittab\n" "\n" "id:3:initdefault:\n" "\n" "si::sysinit:/etc/rc.d/init.d/rc S\n" "\n" "l0:0:wait:/etc/rc.d/init.d/rc 0\n" "l1:S1:wait:/etc/rc.d/init.d/rc 1\n" "l2:2:wait:/etc/rc.d/init.d/rc 2\n" "l3:3:wait:/etc/rc.d/init.d/rc 3\n" "l4:4:wait:/etc/rc.d/init.d/rc 4\n" "l5:5:wait:/etc/rc.d/init.d/rc 5\n" "l6:6:wait:/etc/rc.d/init.d/rc 6\n" "\n" "ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now\n" "\n" "su:S016:once:/sbin/sulogin\n" "\n" "1:2345:respawn:/sbin/agetty --noclear tty1 9600\n" "2:2345:respawn:/sbin/agetty tty2 9600\n" "3:2345:respawn:/sbin/agetty tty3 9600\n" "4:2345:respawn:/sbin/agetty tty4 9600\n" "5:2345:respawn:/sbin/agetty tty5 9600\n" "6:2345:respawn:/sbin/agetty tty6 9600\n" "\n" "# End /etc/inittab</literal>\n" "EOF</userinput>" msgstr "" "<userinput>cat > /etc/inittab << \"EOF\"\n" "<literal># Begin /etc/inittab\n" "\n" "id:3:initdefault:\n" "\n" "si::sysinit:/etc/rc.d/init.d/rc S\n" "\n" "l0:0:wait:/etc/rc.d/init.d/rc 0\n" "l1:S1:wait:/etc/rc.d/init.d/rc 1\n" "l2:2:wait:/etc/rc.d/init.d/rc 2\n" "l3:3:wait:/etc/rc.d/init.d/rc 3\n" "l4:4:wait:/etc/rc.d/init.d/rc 4\n" "l5:5:wait:/etc/rc.d/init.d/rc 5\n" "l6:6:wait:/etc/rc.d/init.d/rc 6\n" "\n" "ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now\n" "\n" "su:S016:once:/sbin/sulogin\n" "\n" "1:2345:respawn:/sbin/agetty --noclear tty1 9600\n" "2:2345:respawn:/sbin/agetty tty2 9600\n" "3:2345:respawn:/sbin/agetty tty3 9600\n" "4:2345:respawn:/sbin/agetty tty4 9600\n" "5:2345:respawn:/sbin/agetty tty5 9600\n" "6:2345:respawn:/sbin/agetty tty6 9600\n" "\n" "# End /etc/inittab</literal>\n" "EOF</userinput>" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:92 msgid "" "An explanation of this initialization file is in the man page for " "<emphasis>inittab</emphasis>. For LFS, the key command that is run is " "<command>rc</command>. The initialization file above will instruct " "<command>rc</command> to run all the scripts starting with an S in the " "<filename class=\"directory\">/etc/rc.d/rcS.d</filename> directory followed " "by all the scripts starting with an S in the <filename class=\"directory\">/" "etc/rc.d/rc?.d</filename> directory where the question mark is specified by " "the initdefault value." msgstr "" "在 <emphasis>inittab</emphasis> 的 man 页面中可以找到对该初始化文件的解释。对" "于 LFS,它指定运行的关键命令是 <command>rc</command>。上面的初始化文件会指" "示 <command>rc</command> 先运行 <filename class=\"directory\">/etc/rc.d/rcS." "d</filename> 目录中所有文件名以 S 开头的脚本,再运行 <filename class=" "\"directory\">/etc/rc.d/rc?.d</filename> 目录中所有文件名以 S 开头的脚本。这" "里问号表示 initdefault 值指定的默认运行级别。" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:101 msgid "" "As a convenience, the <command>rc</command> script reads a library of " "functions in <filename class=\"directory\">/lib/lsb/init-functions</" "filename>. This library also reads an optional configuration file, " "<filename>/etc/sysconfig/rc.site</filename>. Any of the system " "configuration file parameters described in subsequent sections can be " "alternatively placed in this file allowing consolidation of all system " "parameters in this one file." msgstr "" "为了方便起见,<command>rc</command> 脚本从 <filename class=\"directory\">/" "lib/lsb/init-functions</filename> 中读取脚本函数库。该函数库又会读取一个可选" "的配置文件,<filename>/etc/sysconfig/rc.site</filename>。如果您希望将所有系统" "参数集中到一个文件中,可以将以下各节描述的系统配置文件参数都写入这一个文件," #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:109 msgid "" "As a debugging convenience, the functions script also logs all output to " "<filename>/run/var/bootlog</filename>. Since the <filename class=\"directory" "\">/run</filename> directory is a tmpfs, this file is not persistent across " "boots, however it is appended to the more permanent file <filename>/var/log/" "boot.log</filename> at the end of the boot process." msgstr "" "为了方便调试,脚本函数会将所有输出记录到 <filename>/run/var/bootlog</" "filename>。由于 <filename class=\"directory\">/run</filename> 是 tmpfs,这个" "文件在重新启动时不会被保留。然而,在引导过程结束时,该文件的内容会被附加到更" "持久的日志文件 <filename>/var/log/boot.log</filename> 的末尾。" #. type: Content of: <sect1><sect2><sect3><title> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:116 msgid "Changing Run Levels" msgstr "切换运行级别" #. type: Content of: <sect1><sect2><sect3><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:118 msgid "" "Changing run-levels is done with <command>init <replaceable><runlevel>" "</replaceable></command>, where <replaceable><runlevel></replaceable> " "is the target run-level. For example, to reboot the computer, a user could " "issue the <command>init 6</command> command, which is an alias for the " "<command>reboot</command> command. Likewise, <command>init 0</command> is an " "alias for the <command>halt</command> command." msgstr "" "通过命令 <command>init <replaceable><runlevel></replaceable></command> " "可以切换运行级别,这里<replaceable><runlevel></replaceable> 是希望切换" "到的运行级别。例如,为了重新启动计算机,用户可以执行 <command>init 6</" "command> 命令,它和 <command>reboot</command> 作用相同。同样,<command>init " "0</command> 和 <command>halt</command> 作用相同。" #. type: Content of: <sect1><sect2><sect3><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:126 msgid "" "There are a number of directories under <filename class=\"directory\">/etc/" "rc.d</filename> that look like <filename class=\"directory\">rc?.d</" "filename> (where ? is the number of the run-level) and <filename class=" "\"directory\">rcsysinit.d</filename>, all containing a number of symbolic " "links. Some begin with a <emphasis>K</emphasis>, the others begin with an " "<emphasis>S</emphasis>, and all of them have two numbers following the " "initial letter. The K means to stop (kill) a service and the S means to " "start a service. The numbers determine the order in which the scripts are " "run, from 00 to 99—the lower the number the earlier it gets executed. " "When <command>init</command> switches to another run-level, the appropriate " "services are either started or stopped, depending on the runlevel chosen." msgstr "" "在 <filename class=\"directory\">/etc/rc.d</filename> 中有一些名字如同 " "<filename class=\"directory\">rc?.d</filename> 的目录 (这里 ? 是运行级别编" "号),以及一个目录 <filename class=\"directory\">rcsysinit.d</filename>,这些" "目录都包含一些符号链接。它们的文件名都以 <emphasis>K</emphasis> 或 " "<emphasis>S</emphasis> 开头,且文件名中这两个字母之后一定有两位数字。K 表示停" "止 (杀死,kill) 一个服务,而 S 表示启动 (start) 一个服务。两位数字决定脚本运" "行的顺序,从 00 到 99 —— 数字更小的脚本更早执行。当 <command>init</command> " "切换到另一个运行级别时,它会执行这些脚本,从而适当地启动或停止服务,满足选择" "的运行级别要求。" #. type: Content of: <sect1><sect2><sect3><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:138 msgid "" "The real scripts are in <filename class=\"directory\">/etc/rc.d/init.d</" "filename>. They do the actual work, and the symlinks all point to them. K " "links and S links point to the same script in <filename class=\"directory\">/" "etc/rc.d/init.d</filename>. This is because the scripts can be called with " "different parameters like <parameter>start</parameter>, <parameter>stop</" "parameter>, <parameter>restart</parameter>, <parameter>reload</parameter>, " "and <parameter>status</parameter>. When a K link is encountered, the " "appropriate script is run with the <parameter>stop</parameter> argument. " "When an S link is encountered, the appropriate script is run with the " "<parameter>start</parameter> argument." msgstr "" "上述符号链接实际指向的脚本文件位于 <filename class=\"directory\">/etc/rc/" "init.d</filename>。它们完成实际的工作。一对 K 链接和 S 链接指向 <filename " "class=\"directory\">/etc/rc/init.d</filename> 中的同一脚本,这是因为脚本接受" "不同的参数,如<parameter>start</parameter>,<parameter>stop</parameter>," "<parameter>restart</parameter>,<parameter>reload</parameter>,以及 " "<parameter>status</parameter>。在发现 K 链接时,会以 <parameter>stop</" "parameter> 参数运行脚本。在发现 S 链接时,会以 <parameter>start</parameter> " "参数运行脚本。" #. type: Content of: <sect1><sect2><sect3><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:150 msgid "" "There is one exception to this explanation. Links that start with an " "<emphasis>S</emphasis> in the <filename class=\"directory\">rc0.d</filename> " "and <filename class=\"directory\">rc6.d</filename> directories will not " "cause anything to be started. They will be called with the parameter " "<parameter>stop</parameter> to stop something. The logic behind this is that " "when a user is going to reboot or halt the system, nothing needs to be " "started. The system only needs to be stopped." msgstr "" "以上解释有一个例外情况。在文件名以 <emphasis>S</emphasis> 开头的符号链接出现" "在 <filename class=\"directory\">rc0.d</filename> 或 <filename class=" "\"directory\">rc6.d</filename> 中时,它们不会启动任何服务。相反,它们被以参" "数 <parameter>stop</parameter> 调用,并停止服务。这样做的逻辑是,在用户重新启" "动系统或停止系统运行时,不需要启动任何服务,只需要停止整个系统。" #. type: Content of: <sect1><sect2><sect3><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:159 msgid "These are descriptions of what the arguments make the scripts do:" msgstr "下面是脚本接受的不同参数及其解释:" #. type: Content of: <sect1><sect2><sect3><variablelist><varlistentry><term> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:165 msgid "<parameter>start</parameter>" msgstr "<parameter>start</parameter>" #. type: Content of: <sect1><sect2><sect3><variablelist><varlistentry><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:167 msgid "The service is started." msgstr "启动服务。" #. type: Content of: <sect1><sect2><sect3><variablelist><varlistentry><term> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:172 msgid "<parameter>stop</parameter>" msgstr "<parameter>stop</parameter>" #. type: Content of: <sect1><sect2><sect3><variablelist><varlistentry><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:174 msgid "The service is stopped." msgstr "停止服务。" #. type: Content of: <sect1><sect2><sect3><variablelist><varlistentry><term> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:179 msgid "<parameter>restart</parameter>" msgstr "<parameter>restart</parameter>" #. type: Content of: <sect1><sect2><sect3><variablelist><varlistentry><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:181 msgid "The service is stopped and then started again." msgstr "停止服务,再重新启动它。" #. type: Content of: <sect1><sect2><sect3><variablelist><varlistentry><term> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:186 msgid "<parameter>reload</parameter>" msgstr "<parameter>reload</parameter>" #. type: Content of: <sect1><sect2><sect3><variablelist><varlistentry><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:188 msgid "" "The configuration of the service is updated. This is used after the " "configuration file of a service was modified, when the service does not need " "to be restarted." msgstr "" "更新服务配置。当服务的配置文件被修改后,如果不需要重新启动它,就使用该参数。" #. type: Content of: <sect1><sect2><sect3><variablelist><varlistentry><term> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:195 msgid "<parameter>status</parameter>" msgstr "<parameter>status</parameter>" #. type: Content of: <sect1><sect2><sect3><variablelist><varlistentry><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:197 msgid "Tells if the service is running and with which PIDs." msgstr "报告服务是否正在运行中,如果正在运行,报告其 PID。" #. type: Content of: <sect1><sect2><sect3><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:203 msgid "" "Feel free to modify the way the boot process works (after all, it is your " "own LFS system). The files given here are an example of how it can be done." msgstr "" "您可以自由修改引导过程的工作方式 (毕竟这是您自己的 LFS 系统。)我们给出的文件" "只是示例,展示完成引导过程的一种方式。" #. type: Content of: <sect1><sect2><title> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:211 msgid "Udev Bootscripts" msgstr "Udev 引导脚本" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:213 msgid "" "The <filename>/etc/rc.d/init.d/udev</filename> initscript starts " "<command>udevd</command>, triggers any \"coldplug\" devices that have " "already been created by the kernel and waits for any rules to complete. The " "script also unsets the uevent handler from the default of <filename>/sbin/" "hotplug </filename>. This is done because the kernel no longer needs to " "call out to an external binary. Instead <command>udevd</command> will " "listen on a netlink socket for uevents that the kernel raises." msgstr "" "<filename>/etc/rc.d/init.d/udev</filename> 初始化脚本启动 <command>udevd</" "command>,触发内核已经创建的“冷插拔”设备,并等待所有 udev 规则执行完毕。该脚" "本也会取消默认的 uevent 处理程序 <filename>/sbin/hotplug</filename>。这是因为" "内核不再需要调用外部二进制程序。相反,<command>udevd</command> 会监听一个 " "netlink 套接字,以获取内核发出的 uevent 事件。" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:222 msgid "" "The <command>/etc/rc.d/init.d/udev_retry</command> initscript takes care of " "re-triggering events for subsystems whose rules may rely on filesystems that " "are not mounted until the <command>mountfs</command> script is run (in " "particular, <filename class=\"directory\">/usr</filename> and <filename " "class=\"directory\">/var</filename> may cause this). This script runs after " "the <command>mountfs</command> script, so those rules (if re-triggered) " "should succeed the second time around. It is configured from the <filename>/" "etc/sysconfig/udev_retry</filename> file; any words in this file other than " "comments are considered subsystem names to trigger at retry time. To find " "the subsystem of a device, use <command>udevadm info --attribute-walk <" "device></command> where <device> is an absolute path in /dev or /" "sys such as /dev/sr0 or /sys/class/rtc." msgstr "" "<command>/etc/rc.d/init.d/udev_retry</command> 初始化脚本处理一些子系统的重新" "触发事件,这些子系统的规则可能依赖于 <command>mountfs</command> 脚本运行时才" "会挂载的文件系统 (特别地,独立挂载的 <filename class=\"directory\">/usr</" "filename> 和 <filename class=\"directory\">/var</filename> 文件系统会导致这种" "现象)。该脚本在 <command>mountfs</command> 脚本之后运行,因此这些规则 (如果" "被重新触发) 这一次应该能够成功执行。配置文件 <filename>/etc/sysconfig/" "udev_retry</filename> 文件配置该脚本,其中除注释外的每个单词都被认为是一个需" "要重新触发的子系统名。为了找到某个设备的子系统,可以使用命令 " "<command>udevadm info --attribute-walk <device></command>,这里 <" "device> 是一个 /dev 或 /sys 中的绝对路径,例如 /dev/sr0 或 /sys/class/" "rtc。" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:236 msgid "" "For information on kernel module loading and udev, see <xref linkend=" "\"module-loading\"/>." msgstr "" "参阅<xref linkend=\"module-loading\"/>了解更多关于模块加载和 udev 的信息。" #. type: Content of: <sect1><sect2><title> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:241 msgid "Configuring the System Clock" msgstr "配置系统时钟" #. type: Content of: <sect1><sect2><indexterm><primary> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:244 msgid "setclock" msgstr "setclock" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:247 msgid "" "The <command>setclock</command> script reads the time from the hardware " "clock, also known as the BIOS or the Complementary Metal Oxide Semiconductor " "(CMOS) clock. If the hardware clock is set to UTC, this script will convert " "the hardware clock's time to the local time using the <filename>/etc/" "localtime</filename> file (which tells the <command>hwclock</command> " "program which timezone to use). There is no way to detect whether or not the " "hardware clock is set to UTC, so this needs to be configured manually." msgstr "" "<command>setclock</command> 脚本从硬件时钟读取时间,硬件时钟也常被称为 BIOS " "时钟或互补金属氧化物半导体 (CMOS) 时钟。如果硬件时钟被设为 UTC 时间,该脚本会" "根据 <filename>/etc/localtime</filename> 文件 (它告知 <command>hwclock</" "command> 程序用户处于哪个时区),将硬件时钟的时间转换成本地时间。不存在确定硬" "件时钟是否为 UTC 的方法,因此这必须手动设置。" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:256 msgid "" "The <command>setclock</command> program is run via <application>udev</" "application> when the kernel detects the hardware capability upon boot. It " "can also be run manually with the stop parameter to store the system time to " "the CMOS clock." msgstr "" "<command>setclock</command> 在引导后,由内核检测硬件功能时通过 " "<application>udev</application> 执行。可以用 stop 参数手动调用它,以将系统时" "间写入 CMOS 时钟。" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:261 msgid "" "If you cannot remember whether or not the hardware clock is set to UTC, find " "out by running the <userinput>hwclock --localtime --show</userinput> " "command. This will display what the current time is according to the " "hardware clock. If this time matches whatever your watch says, then the " "hardware clock is set to local time. If the output from <command>hwclock</" "command> is not local time, chances are it is set to UTC time. Verify this " "by adding or subtracting the proper amount of hours for the timezone to the " "time shown by <command>hwclock</command>. For example, if you are currently " "in the MST timezone, which is also known as GMT -0700, add seven hours to " "the local time." msgstr "" "如果您不确定您的硬件时钟是否设置为 UTC,运行 <userinput>hwclock --localtime " "--show</userinput> 命令,它会显示硬件时钟给出的当前时间。如果这个时间和您的手" "表显示的一致,则说明硬件时钟被设定为本地时间。相反,如果 <command>hwclock</" "command> 输出的时间不是本地时间,则硬件时钟很可能被设定为 UTC 时间。根据您的" "时区,在 <command>hwclock</command> 显示的时间上加减对应的小时数,进行进一步" "的验证。例如,如果您现在处于莫斯科时区,即 GMT -0700,在本地时间上加 7 小" "时,再进行比较。" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:272 msgid "" "Change the value of the <envar>UTC</envar> variable below to a value of " "<parameter>0</parameter> (zero) if the hardware clock is <emphasis>NOT</" "emphasis> set to UTC time." msgstr "" "将下面的配置文件中的 <envar>UTC</envar> 变量值改为 <parameter>0</parameter> " "(零),表示硬件时钟<emphasis>没有</emphasis>设为 UTC。" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:276 msgid "" "Create a new file <filename>/etc/sysconfig/clock</filename> by running the " "following:" msgstr "" "执行以下命令,创建新的 <filename>/etc/sysconfig/clock</filename> 文件:" #. type: Content of: <sect1><sect2><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:279 #, no-wrap msgid "" "<userinput>cat > /etc/sysconfig/clock << \"EOF\"\n" "<literal># Begin /etc/sysconfig/clock\n" "\n" "UTC=1\n" "\n" "# Set this to any options you might need to give to hwclock,\n" "# such as machine hardware clock type for Alphas.\n" "CLOCKPARAMS=\n" "\n" "# End /etc/sysconfig/clock</literal>\n" "EOF</userinput>" msgstr "" "<userinput>cat > /etc/sysconfig/clock << \"EOF\"\n" "<literal># Begin /etc/sysconfig/clock\n" "\n" "UTC=1\n" "\n" "# Set this to any options you might need to give to hwclock,\n" "# such as machine hardware clock type for Alphas.\n" "CLOCKPARAMS=\n" "\n" "# End /etc/sysconfig/clock</literal>\n" "EOF</userinput>" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:291 msgid "" "A good hint explaining how to deal with time on LFS is available at <ulink " "url=\"&hints-root;time.txt\"/>. It explains issues such as time zones, UTC, " "and the <envar>TZ</envar> environment variable." msgstr "" "在 <ulink url=\"&hints-root;time.txt\"/> 可以找到一个较好地介绍了如何在 LFS " "中处理时间问题的 hint。它解释了与时区,UTC,以及 <envar>TZ</envar> 环境变量相" "关的问题。" #. type: Content of: <sect1><sect2><note><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:295 msgid "" "The CLOCKPARAMS and UTC paramaters may also be set in the <filename>/etc/" "sysconfig/rc.site</filename> file." msgstr "" "CLOCKPARAMS 和 UTC 参数也可以在 <filename>/etc/sysconfig/rc.site</filename> " "文件中设置。" #. type: Content of: <sect1><sect2><title> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:303 msgid "Configuring the Linux Console" msgstr "配置 Linux 控制台" #. type: Content of: <sect1><sect2><indexterm><primary> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:306 msgid "console" msgstr "console" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:310 msgid "" "This section discusses how to configure the <command>console</command> " "bootscript that sets up the keyboard map, console font, and console kernel " "log level. If non-ASCII characters (e.g., the copyright sign, the British " "pound sign and Euro symbol) will not be used and the keyboard is a U.S. one, " "much of this section can be skipped. Without the configuration file, (or " "equivalent settings in <filename>rc.site</filename>), the <command>console</" "command> bootscript will do nothing." msgstr "" "本节讨论如何配置 <command>console</command> 引导脚本,使之正确设定键盘映射," "控制台字体,以及控制台内核日志级别。如果不使用非 ASCII 字符 (如版权符号,英镑" "符号,或者欧元符号),而且使用美式键盘,则可以忽略本节的大多数内容。如果不创建" "本节的配置文件 (且 <filename>rc.site</filename> 中没有对应的设置),则 " "<command>console</command> 脚本什么也不做。" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:318 msgid "" "The <command>console</command> script reads the <filename>/etc/sysconfig/" "console</filename> file for configuration information. Decide which keymap " "and screen font will be used. Various language-specific HOWTOs can also help " "with this, see <ulink url=\"http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang." "html\"/>. If still in doubt, look in the <filename class=\"directory\">/usr/" "share/keymaps</filename> and <filename class=\"directory\">/usr/share/" "consolefonts</filename> directories for valid keymaps and screen fonts. Read " "<filename>loadkeys(1)</filename> and <filename>setfont(8)</filename> manual " "pages to determine the correct arguments for these programs." msgstr "" "<command>console</command> 脚本读取 <filename>/etc/sysconfig/console</" "filename> 中的配置信息。它根据配置决定使用何种键映射和控制台字体。一些与特定" "语言相关的 HOWTO 文档可以帮助您进行配置,参阅 <ulink url=\"http://www.tldp." "org/HOWTO/HOWTO-INDEX/other-lang.html\"/>。如果仍然有疑问,在<filename class=" "\"directory\">/usr/share/keymaps</filename> 和 <filename class=\"directory" "\">/usr/share/consolefonts</filename> 中寻找可用的键映射和控制台字体,并阅读 " "<filename>loadkeys(1)</filename> 和 <filename>setfont(8)</filename> man 页" "面,以确认应该传递给这两个程序的正确参数。" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:329 msgid "" "The <filename>/etc/sysconfig/console</filename> file should contain lines of " "the form: VARIABLE=\"value\". The following variables are recognized:" msgstr "" "<filename>/etc/sysconfig/console</filename> 文件应该包含若干行,每一行的的格" "式都是:变量名=\"值\"。下列变量名会被识别:" #. type: Content of: <sect1><sect2><variablelist><varlistentry><term> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:334 msgid "LOGLEVEL" msgstr "LOGLEVEL" #. type: Content of: <sect1><sect2><variablelist><varlistentry><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:336 msgid "" "This variable specifies the log level for kernel messages sent to the " "console as set by <command>dmesg -n</command>. Valid levels are from " "\"1\" (no messages) to \"8\". The default level is \"7\"." msgstr "" "该变量指定被发送到控制台的内核消息日志级别,正如使用 <command>dmesg</" "command> 设置的那样。有效的级别是“1” (不输出内核消息) 到“8”之间的某个数。" "默认的日志级别是“7”。" #. type: Content of: <sect1><sect2><variablelist><varlistentry><term> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:343 msgid "KEYMAP" msgstr "KEYMAP" #. type: Content of: <sect1><sect2><variablelist><varlistentry><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:345 msgid "" "This variable specifies the arguments for the <command>loadkeys</command> " "program, typically, the name of keymap to load, e.g., <quote>it</quote>. If " "this variable is not set, the bootscript will not run the <command>loadkeys</" "command> program, and the default kernel keymap will be used. Note that a " "few keymaps have multiple versions with the same name (cz and its variants " "in qwerty/ and qwertz/, es in olpc/ and qwerty/, and trf in fgGIod/ and " "qwerty/). In these cases the parent directory should also be specified (e.g. " "qwerty/es) to ensure the proper keymap is loaded." msgstr "" "该变量指定传递给 <command>loadkeys</command> 程序的参数,它通常是需要加载的键" "映射名,例如<quote>it</quote>。如果这个变量没有设定,引导脚本不会运行 " "<command>loadkeys</command>,系统将使用内核的默认键映射。注意某些键映射有文件" "名相同的不同版本 (例如 cz 的和它的变体在 qwerty/ 和 qwertz/ 中,es 在 olpc/ " "和 qwerty/ 中,以及 trf 在 fgGIod/ 和 qwerty/ 中)。在这种情况下,父目录名也要" "指定 (例如 qwerty/es),以保证加载正确的键映射。" #. type: Content of: <sect1><sect2><variablelist><varlistentry><term> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:359 msgid "KEYMAP_CORRECTIONS" msgstr "KEYMAP_CORRECTIONS" #. type: Content of: <sect1><sect2><variablelist><varlistentry><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:361 msgid "" "This (rarely used) variable specifies the arguments for the second call to " "the <command>loadkeys</command> program. This is useful if the stock keymap " "is not completely satisfactory and a small adjustment has to be made. E.g., " "to include the Euro sign into a keymap that normally doesn't have it, set " "this variable to <quote>euro2</quote>." msgstr "" "这个 (很少使用的) 变量指定第二次调用 <command>loadkeys</command> 程序时使用的" "参数。如果现有的键映射不完全符合要求,需要进行微调,这个变量是很有用的。例" "如,如果需要为通常不包含欧元符号的键映射添加它,将这个变量设为<quote>euro2</" "quote>。" #. type: Content of: <sect1><sect2><variablelist><varlistentry><term> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:371 msgid "FONT" msgstr "FONT" #. because of the copyright sign #. type: Content of: <sect1><sect2><variablelist><varlistentry><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:373 msgid "" "This variable specifies the arguments for the <command>setfont</command> " "program. Typically, this includes the font name, <quote>-m</quote>, and the " "name of the application character map to load. E.g., in order to load the " "<quote>lat1-16</quote> font together with the <quote>8859-1</quote> " "application character map (as it is appropriate in the USA), set this " "variable to <quote>lat1-16 -m 8859-1</quote>. In UTF-8 mode, the kernel " "uses the application character map for conversion of composed 8-bit key " "codes in the keymap to UTF-8, and thus the argument of the \"-m\" parameter " "should be set to the encoding of the composed key codes in the keymap." msgstr "" "该变量指定传递给 <command>setfont</command> 程序的参数。通常它包含字体名," "<quote>-m</quote>,以及需要加载的应用程序字符映射名。例如,为了加载 " "<quote>lat1-16</quote>字体和<quote>8859-1</quote>应用程序字符映射 (这适用" "于美国),可以将该变量设置为<quote>lat1-16 -m 8859-1</quote>。在 UTF-8 模式" "下,内核使用应用程序字符映射将键映射中编组的 8 位键码转化为 UTF-8,因此 “-m” " "参数的值应该被设定为键映射中编组的键码编码。" #. type: Content of: <sect1><sect2><variablelist><varlistentry><term> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:390 msgid "UNICODE" msgstr "UNICODE" #. type: Content of: <sect1><sect2><variablelist><varlistentry><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:392 msgid "" "Set this variable to <quote>1</quote>, <quote>yes</quote> or <quote>true</" "quote> in order to put the console into UTF-8 mode. This is useful in UTF-8 " "based locales and harmful otherwise." msgstr "" "将该变量设为<quote>1</quote>,<quote>yes</quote>,或者<quote>true</quote>," "可以将控制台设置于 UTF-8 模式。这对于基于 UTF-8 的 locale 很有用,但对于其他 " "locale 有害。" #. type: Content of: <sect1><sect2><variablelist><varlistentry><term> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:400 msgid "LEGACY_CHARSET" msgstr "LEGACY_CHARSET" #. type: Content of: <sect1><sect2><variablelist><varlistentry><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:402 msgid "" "For many keyboard layouts, there is no stock Unicode keymap in the Kbd " "package. The <command>console</command> bootscript will convert an available " "keymap to UTF-8 on the fly if this variable is set to the encoding of the " "available non-UTF-8 keymap." msgstr "" "对于许多键盘布局,Kbd 软件包没有提供 Unicode 键映射。如果该变量被设定为一个可" "用的非 UTF-8 键映射的编码,<command>console</command> 引导脚本会在需要时将可" "用的键映射转换成 UTF-8。" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:411 msgid "Some examples:" msgstr "一些例子:" #. type: Content of: <sect1><sect2><itemizedlist><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:416 msgid "" "For a non-Unicode setup, only the KEYMAP and FONT variables are generally " "needed. E.g., for a Polish setup, one would use:" msgstr "" "对于非 Unicode 配置,一般只需要设置 KEYMAP 和 FONT 两个变量。例如,下面是一个" "波兰语配置:" #. type: Content of: <sect1><sect2><itemizedlist><listitem><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:418 #, no-wrap msgid "" "<userinput>cat > /etc/sysconfig/console << \"EOF\"\n" "<literal># Begin /etc/sysconfig/console\n" "\n" "KEYMAP=\"pl2\"\n" "FONT=\"lat2a-16 -m 8859-2\"\n" "\n" "# End /etc/sysconfig/console</literal>\n" "EOF</userinput>" msgstr "" "<userinput>cat > /etc/sysconfig/console << \"EOF\"\n" "<literal># Begin /etc/sysconfig/console\n" "\n" "KEYMAP=\"pl2\"\n" "FONT=\"lat2a-16 -m 8859-2\"\n" "\n" "# End /etc/sysconfig/console</literal>\n" "EOF</userinput>" #. type: Content of: <sect1><sect2><itemizedlist><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:429 msgid "" "As mentioned above, it is sometimes necessary to adjust a stock keymap " "slightly. The following example adds the Euro symbol to the German keymap:" msgstr "" "正如前文所述,有时需要微调一个现有的键映射。下面的例子为德语键映射添加欧元符" "号:" #. type: Content of: <sect1><sect2><itemizedlist><listitem><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:433 #, no-wrap msgid "" "<userinput>cat > /etc/sysconfig/console << \"EOF\"\n" "<literal># Begin /etc/sysconfig/console\n" "\n" "KEYMAP=\"de-latin1\"\n" "KEYMAP_CORRECTIONS=\"euro2\"\n" "FONT=\"lat0-16 -m 8859-15\"\n" "UNICODE=\"1\"\n" "\n" "# End /etc/sysconfig/console</literal>\n" "EOF</userinput>" msgstr "" "<userinput>cat > /etc/sysconfig/console << \"EOF\"\n" "<literal># Begin /etc/sysconfig/console\n" "\n" "KEYMAP=\"de-latin1\"\n" "KEYMAP_CORRECTIONS=\"euro2\"\n" "FONT=\"lat0-16 -m 8859-15\"\n" "UNICODE=\"1\"\n" "\n" "# End /etc/sysconfig/console</literal>\n" "EOF</userinput>" #. type: Content of: <sect1><sect2><itemizedlist><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:446 msgid "" "The following is a Unicode-enabled example for Bulgarian, where a stock " "UTF-8 keymap exists:" msgstr "" "下面是一个使用 Unicode 的白俄罗斯语配置,白俄罗斯语有现有的 UTF-8 键映射:" #. This is what is used by jhalfs for creating the console file: whenever #. you change the following, please inform the jhalfs maintainer(s). #. type: Content of: <sect1><sect2><itemizedlist><listitem><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:450 #, no-wrap msgid "" "<userinput>cat > /etc/sysconfig/console << \"EOF\"\n" "<literal># Begin /etc/sysconfig/console\n" "\n" "UNICODE=\"1\"\n" "KEYMAP=\"bg_bds-utf8\"\n" "FONT=\"LatArCyrHeb-16\"\n" "\n" "# End /etc/sysconfig/console</literal>\n" "EOF</userinput>" msgstr "" "<userinput>cat > /etc/sysconfig/console << \"EOF\"\n" "<literal># Begin /etc/sysconfig/console\n" "\n" "UNICODE=\"1\"\n" "KEYMAP=\"bg_bds-utf8\"\n" "FONT=\"LatArCyrHeb-16\"\n" "\n" "# End /etc/sysconfig/console</literal>\n" "EOF</userinput>" #. type: Content of: <sect1><sect2><itemizedlist><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:462 msgid "" "Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous example, " "bright colors are no longer available on the Linux console unless a " "framebuffer is used. If one wants to have bright colors without a " "framebuffer and can live without characters not belonging to his language, " "it is still possible to use a language-specific 256-glyph font, as " "illustrated below:" msgstr "" "由于在上面的例子中使用了 512 个字形的 LatArCyrHeb-16 字体,在 Linux 控制台中" "不能使用明亮的颜色,除非使用了帧缓冲。如果希望在没有帧缓冲的情况下继续使用明" "亮的颜色,且不需要那些不属于自己母语的字符,可以使用专用于一种语言的 256 字形" "字体,配置文件如下:" #. type: Content of: <sect1><sect2><itemizedlist><listitem><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:469 #, no-wrap msgid "" "<userinput>cat > /etc/sysconfig/console << \"EOF\"\n" "<literal># Begin /etc/sysconfig/console\n" "\n" "UNICODE=\"1\"\n" "KEYMAP=\"bg_bds-utf8\"\n" "FONT=\"cyr-sun16\"\n" "\n" "# End /etc/sysconfig/console</literal>\n" "EOF</userinput>" msgstr "" "<userinput>cat > /etc/sysconfig/console << \"EOF\"\n" "<literal># Begin /etc/sysconfig/console\n" "\n" "UNICODE=\"1\"\n" "KEYMAP=\"bg_bds-utf8\"\n" "FONT=\"cyr-sun16\"\n" "\n" "# End /etc/sysconfig/console</literal>\n" "EOF</userinput>" #. type: Content of: <sect1><sect2><itemizedlist><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:481 msgid "" "The following example illustrates keymap autoconversion from ISO-8859-15 to " "UTF-8 and enabling dead keys in Unicode mode:" msgstr "" "下面的例子展示了从 ISO-8859-1 到 UTF-8 的键映射自动转换,同时在 Unicode 模式" "下启用了死键:" #. type: Content of: <sect1><sect2><itemizedlist><listitem><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:484 #, no-wrap msgid "" "<userinput>cat > /etc/sysconfig/console << \"EOF\"\n" "<literal># Begin /etc/sysconfig/console\n" "\n" "UNICODE=\"1\"\n" "KEYMAP=\"de-latin1\"\n" "KEYMAP_CORRECTIONS=\"euro2\"\n" "LEGACY_CHARSET=\"iso-8859-15\"\n" "FONT=\"LatArCyrHeb-16 -m 8859-15\"\n" "\n" "# End /etc/sysconfig/console</literal>\n" "EOF</userinput>" msgstr "" "<userinput>cat > /etc/sysconfig/console << \"EOF\"\n" "<literal># Begin /etc/sysconfig/console\n" "\n" "UNICODE=\"1\"\n" "KEYMAP=\"de-latin1\"\n" "KEYMAP_CORRECTIONS=\"euro2\"\n" "LEGACY_CHARSET=\"iso-8859-15\"\n" "FONT=\"LatArCyrHeb-16 -m 8859-15\"\n" "\n" "# End /etc/sysconfig/console</literal>\n" "EOF</userinput>" #. type: Content of: <sect1><sect2><itemizedlist><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:498 msgid "" "Some keymaps have dead keys (i.e., keys that don't produce a character by " "themselves, but put an accent on the character produced by the next key) or " "define composition rules (such as: <quote>press Ctrl+. A E to get Æ</" "quote> in the default keymap). Linux-&linux-version; interprets dead keys " "and composition rules in the keymap correctly only when the source " "characters to be composed together are not multibyte. This deficiency " "doesn't affect keymaps for European languages, because there accents are " "added to unaccented ASCII characters, or two ASCII characters are composed " "together. However, in UTF-8 mode it is a problem; e.g., for the Greek " "language, where one sometimes needs to put an accent on the letter " "<quote>alpha</quote>. The solution is either to avoid the use of UTF-8, or " "to install the X window system that doesn't have this limitation in its " "input handling." msgstr "" "某些键映射有死键 (即,这些键本身不产生字符,而是在下一次按键产生的字符上附加" "音调) 或定义了组合规则 (例如在默认键映射中,<quote>按下 Ctrl+. A E 得到 " "Æ</quote>)。Linux-&linux-version; 只有在被组合的不是多字节字符的情况" "下,才能正常解析死键和组合规则。这个缺陷不影响欧洲语言的键映射,因为在欧洲语" "言中要么是一个音调被附加到不带音调的 ASCII 字符上,要么是两个 ASCII 字符被组" "合在一起。然而,在 UTF-8 模式中,以希腊语为例,当某人要在<quote>alpha</" "quote>字符上附加音调时,就会出现问题。解决方法是要么不使用 UTF-8,要么安装 X " "窗口系统,它处理输入时没有这个限制。" #. type: Content of: <sect1><sect2><itemizedlist><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:515 msgid "" "For Chinese, Japanese, Korean, and some other languages, the Linux console " "cannot be configured to display the needed characters. Users who need such " "languages should install the X Window System, fonts that cover the necessary " "character ranges, and the proper input method (e.g., SCIM, supports a wide " "variety of languages)." msgstr "" "对于中文,日文,韩文,以及其他一些语言文字,无论如何配置 Linux 控制台,都不可" "能正常显示所需要的字符。这些语言的用户应该安装 X 窗口系统,能够覆盖所需要的字" "符的字体,以及合适的输入法 (如 SCIM 支持许多语言的输入)。" #. type: Content of: <sect1><sect2><note><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:527 msgid "" "The <filename>/etc/sysconfig/console</filename> file only controls the Linux " "text console localization. It has nothing to do with setting the proper " "keyboard layout and terminal fonts in the X Window System, with ssh " "sessions, or with a serial console. In such situations, limitations " "mentioned in the last two list items above do not apply." msgstr "" "<filename>/etc/sysconfig/console</filename> 文件只控制 Linux 字符控制台的本地" "化。它和 X 窗口系统,ssh 连接,或者串口终端中的键盘布局设置和终端字体毫无关" "系。在这些情况下,不存在上述的两项限制。" #. type: Content of: <sect1><sect2><title> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:537 msgid "Creating Files at Boot" msgstr "在引导时创建文件" #. type: Content of: <sect1><sect2><indexterm><primary> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:540 msgid "File creation at boot" msgstr "File creation at boot" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:544 msgid "" "At times, it is desirable to create files at boot time. For instance, the " "<filename class=\"directory\">/tmp/.ICE-unix</filename> directory is often " "needed. This can be done by creating an entry in the <filename>/etc/" "sysconfig/createfiles</filename> configuration script. The format of this " "file is embedded in the comments of the default configuration file." msgstr "" "有时,我们希望在引导时创建一些文件,例如可能需要 <filename class=\"directory" "\">/tmp/.ICE-unix</filename> 目录。为此,可以在 <filename>/etc/sysconfig/" "createfiles</filename> 配置脚本中创建一项。该文件的格式包含在默认配置文件的注" "释中。" #. type: Content of: <sect1><sect2><title> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:553 msgid "Configuring the sysklogd Script" msgstr "配置 sysklogd 脚本" #. type: Content of: <sect1><sect2><indexterm><primary> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:556 msgid "sysklogd" msgstr "sysklogd" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:560 msgid "" "The <filename>sysklogd</filename> script invokes the <command>syslogd</" "command> program as a part of System V initialization. The <parameter>-m 0</" "parameter> option turns off the periodic timestamp mark that " "<command>syslogd</command> writes to the log files every 20 minutes by " "default. If you want to turn on this periodic timestamp mark, edit " "<filename>/etc/sysconfig/rc.site</filename> and define the variable " "SYSKLOGD_PARMS to the desired value. For instance, to remove all " "parameters, set the variable to a null value:" msgstr "" "<filename>sysklogd</filename> 脚本启动 <command>sysklogd</command> 程序,这" "是 System V 初始化过程的一部分。<parameter>-m 0</parameter> 选项关闭 " "<command>sysklogd</command> 每 20 分钟写入日志文件的时间戳。如果您希望启用这" "个周期性时间戳标志,将 SYSKLOGD_PARMS 定义为您希望的值。例如,如果要删除所有" "参数,将该变量设定为空:" #. type: Content of: <sect1><sect2><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:569 #, no-wrap msgid "SYSKLOGD_PARMS=" msgstr "SYSKLOGD_PARMS=" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:571 msgid "See <userinput>man syslogd</userinput> for more options." msgstr "参阅 <userinput>man syslogd</userinput> 了解更多可用选项。" #. type: Content of: <sect1><sect2><title> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:576 msgid "The rc.site File" msgstr "rc.site 文件" #. type: Content of: <sect1><sect2><indexterm><primary> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:579 msgid "rc.site" msgstr "rc.site" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:582 msgid "" "The optional <filename>/etc/sysconfig/rc.site</filename> file contains " "settings that are automatically set for each SystemV boot script. It can " "alternatively set the values specified in the <filename>hostname</filename>, " "<filename>console</filename>, and <filename>clock</filename> files in the " "<filename class='directory'>/etc/sysconfig/</filename> directory. If the " "associated variables are present in both these separate files and " "<filename>rc.site</filename>, the values in the script specific files have " "precedence." msgstr "" "可选的 <filename>/etc/sysconfig/rc.site</filename> 文件包含了为每个 System V " "引导脚本自动设定的配置。<filename class=\"directory\">/etc/sysconfig/</" "filename> 目录中 <filename>hostname</filename>,<filename>console</" "filename>,以及 <filename>clock</filename> 文件中的变量值也可以在这里设定。如" "果这些分立的文件和 <filename>rc.site</filename> 包含相同的变量名,则分立文件中" "的设定被优先使用。" #. type: Content of: <sect1><sect2><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:591 msgid "" "<filename>rc.site</filename> also contains parameters that can customize " "other aspects of the boot process. Setting the IPROMPT variable will enable " "selective running of bootscripts. Other options are described in the file " "comments. The default version of the file is as follows:" msgstr "" "<filename>rc.site</filename> 也包含自定义引导过程其他属性的参数。设定 " "IPROMPT 变量会启用引导脚本的选择性执行。其他选项在文件注释中描述。该文件的默" "认版本如下:" #. Use role to fix a pdf generation problem #. type: Content of: <sect1><sect2><screen> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:597 #, no-wrap msgid "&site;" msgstr "&site;" #. type: Content of: <sect1><sect2><sect3><title> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:600 msgid "Customizing the Boot and Shutdown Scripts" msgstr "自定义引导和关机脚本" #. type: Content of: <sect1><sect2><sect3><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:602 msgid "" "The LFS boot scripts boot and shut down a system in a fairly efficient " "manner, but there are a few tweaks that you can make in the rc.site file to " "improve speed even more and to adjust messages according to your " "preferences. To do this, adjust the settings in the <filename>/etc/sysconfig/" "rc.site</filename> file above." msgstr "" "LFS 引导脚本能够较为高效地引导和关闭系统,但是您仍然可以微调rc.site 文件以进" "一步提高速度,或根据您的个人品味调整引导消息。为此,需要修改上面给出的" "<filename>/etc/sysconfig/rc.site</filename> 文件。" #. type: Content of: <sect1><sect2><sect3><itemizedlist><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:610 msgid "" "During the boot script <filename>udev</filename>, there is a call to " "<command>udev settle</command> that requires some time to complete. This " "time may or may not be required depending on devices present in the system. " "If you only have simple partitions and a single ethernet card, the boot " "process will probably not need to wait for this command. To skip it, set " "the variable OMIT_UDEV_SETTLE=y." msgstr "" "在引导脚本 <filename>udev</filename> 的执行过程中,它会调用 <command>udev " "settle</command>,该命令需要一段时间才能完成。您的系统可能真的需要这段时间," "也可能实际上并不需要,这和系统中的设备有关。如果您只有简单分区,且只有一块网" "卡,引导过程可能并不需要等待该命令。设定 OMIT_UDEV_SETTLE=y 可以跳过它。" #. type: Content of: <sect1><sect2><sect3><itemizedlist><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:617 msgid "" "The boot script <filename>udev_retry</filename> also runs <command>udev " "settle</command> by default. This command is only needed by default if the " "<filename class='directory'>/var</filename> directory is separately " "mounted. This is because the clock needs the file <filename>/var/lib/" "hwclock/adjtime</filename>. Other customizations may also need to wait for " "udev to complete, but in many installations it is not needed. Skip the " "command by setting the variable OMIT_UDEV_RETRY_SETTLE=y." msgstr "" "引导脚本 <filename>udev_retry</filename> 在默认配置下也会执行 <command>udev " "settle</command>。对于默认配置,这仅仅在 <filename class='directory'>/var</" "filename> 目录是独立挂载的文件系统时才有必要。原因是,系统时钟需要 " "<filename>/var/lib/hwclock/adjtime</filename> 文件。其他的自定义配置也可能导致" "存在等待 udev 完成的必要性,但在大多数配置中并没有这种必要。设定 " "OMIT_UDEV_RETRY_SETTLE=y 可以跳过它。" #. type: Content of: <sect1><sect2><sect3><itemizedlist><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:626 msgid "" "By default, the file system checks are silent. This can appear to be a " "delay during the bootup process. To turn on the <command>fsck</command> " "output, set the variable VERBOSE_FSCK=y." msgstr "" "默认配置中,文件系统检查是静默的。这可能看上去像引导过程中的时延。设定变量 " "VERBOSE_FSCK=y 可以显示 <command>fsck</command> 的输出。" #. type: Content of: <sect1><sect2><sect3><itemizedlist><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:631 msgid "" "When rebooting, you may want to skip the filesystem check, <command>fsck</" "command>, completely. To do this, either create the file <filename>/" "fastboot</filename> or reboot the system with the command <command>/sbin/" "shutdown -f -r now</command>. On the other hand, you can force all file " "systems to be checked by creating <filename>/forcefsck</filename> or running " "<command>shutdown</command> with the <parameter>-F</parameter> parameter " "instead of <parameter>-f</parameter>." msgstr "" "在重新启动系统时,您可能希望完全跳过进行文件系统检查的 <command>fsck</" "command> 命令。为此,可以创建一个文件 <filename>/fastboot</filename>,或者使" "用命令 <command>/sbin/shutdown -f -r now</command>。反之,如果您希望在重新启" "动系统时强制检查所有文件系统,可以创建文件 <filename>/forcefsck</filename>," "或者在前面的 <command>shutdown</command> 命令中使用 <parameter>-F</" "parameter> 参数代替 <parameter>-f</parameter>。" #. type: Content of: <sect1><sect2><sect3><itemizedlist><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:640 msgid "" "Setting the variable FASTBOOT=y will disable <command>fsck</command> during " "the boot process until it is removed. This is not recommended on a " "permanent basis." msgstr "" "设定变量 FASTBOOT=y 会在引导过程中完全禁止 <command>fsck</command>,直到移除" "该变量。从长远角度看,不推荐使用它。" #. type: Content of: <sect1><sect2><sect3><itemizedlist><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:644 msgid "" "Normally, all files in the <filename class='directory'>/tmp</filename> " "directory are deleted at boot time. Depending on the number of files or " "directories present, this can cause a noticeable delay in the boot process. " "To skip removing these files set the variable SKIPTMPCLEAN=y." msgstr "" "通常,<filename class='directory'>/tmp</filename> 目录中的所有文件都会在引导" "过程中被删除。如果其中有较多的文件或目录,可能导致引导过程中出现可观的延时。" "设定变量 SKIPTMPCLEAN=y 可以跳过删除这些文件的引导步骤。" #. type: Content of: <sect1><sect2><sect3><itemizedlist><listitem><para> #: /home/xry111/svn-repos/LFS-BOOK/chapter09/usage.xml:650 msgid "" "During shutdown, the <command>init</command> program sends a TERM signal to " "each program it has started (e.g. agetty), waits for a set time (default 3 " "seconds), and sends each process a KILL signal and waits again. This " "process is repeated in the <command>sendsignals</command> script for any " "processes that are not shut down by their own scripts. The delay for " "<command>init</command> can be set by passing a parameter. For example to " "remove the delay in <command>init</command>, pass the -t0 parameter when " "shutting down or rebooting (e.g. <command>/sbin/shutdown -t0 -r now</" "command>). The delay for the <command>sendsignals</command> script can be " "skipped by setting the parameter KILLDELAY=0." msgstr "" "在关机时,<command>init</command> 程序会向它启动的每个程序 (例如 agetty) 发" "送 TERM 信号,等待一段固定的时间 (默认是 3 秒),然后向每个进程发送 KILL 信" "号,再等待一次。信号,"