当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 3 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : inittab文件格式说明,请求版主开通博客
帖子发表于 : 2006-11-05 0:47 

注册: 2006-10-02 0:40
帖子: 14
送出感谢: 0 次
接收感谢: 0 次
inittab文件格式说明的中文翻译,是本人的第一次翻译,请版主斧正

原文出处:ubuntu man page
原文作者:Sebastian Lederer (lederer@francium.infor‐matik.uni-bonn.de)
授权许可:
翻译人员:黎小波
校对人员:
贡献者:
适用版本:ubuntu6.10
文章状态:[等待校对]
Inittab文件使用说明
NAME
名称:
inittab - format of the inittab file used by the sysv-compatible init process inittab – inittab文件用于与sysv兼容的初始化程序
DESCRIPTION
The inittab file describes which processes are started at bootup and during normal operation (e.g. /etc/init.d/boot, /etc/init.d/rc, gettys...). Init(8) distinguishes multiple runlevels, each of which can have its own set of processes that are started. Valid runlevels are 0-6 plus A, B, and C for ondemand entries. An entry in the inittab file has the following format:
说明:Inittab文件描述了在系统启动和正常操作期间(如/etc/init.d/boot,/etc/init.d/rc,gettys等)将运行哪些程序。Init区别不同的运行级别,每一种运行级别都有自己一系列的程序。有效的运行级别有0-6级,如为Ondemand条目,还可包括A,B,C。在inittab文件中,每一条目的格式如下:
id:runlevels:action:process
id:运行级:动作:命令
Lines beginning with ‘#’ are ignored.
如果以“#”开头,则该行为注释,将被忽略。
id is a unique sequence of 1-4 characters which identifies an entry in inittab (for versions of sysvinit compiled with the old libc5 (< 5.2.18) or a.out libraries the limit is 2 characters).
Id:是一个唯一的由1-4个字符组成的标识符,标识inittab文件中的每一个条目(在老的libc5(<5.2.18)版本编译的sysvinit或a.out库,限2个字符)。
Note: traditionally, for getty and other login processes, the value of the id field is kept the same as the suffix of the corresponding tty, e.g. 1 for tty1. Some ancient login accounting programs might expect this, though I can’t think of any.
注释:传统地,对于getty或其它的登录程序,id的值保持与相应的tty后缀的值一样,如tty1则id为1,一些老的登录统计程序可能希望如此,但我不这样认为。
runlevels lists the runlevels for which the specified action should be taken.
运行级别:列出将进行特定动作的动作级别
action describes which action should be taken.
动作描述了将要采取什么动作
process specifies the process to be executed. If the process field starts with a ‘+’ character, init will not do utmp and wtmp accounting for that process. This is needed for gettys that insist on doing their own utmp/wtmp housekeeping. This is also a historic bug.
命令:将被执行的命令。如果命令以“+”号开始,则init不会对该命令进行utmp和wtmp的统计。对gettys来说,却需要对utmp/wtmp进行管理。这也是历史上有名的bug.
The runlevels field may contain multiple characters for different run‐levels. For example, 123 specifies that the process should be started in runlevels 1, 2, and 3. The runlevels for ondemand entries may contain an A, B, or C. The runlevels field of sysinit, boot, and bootwait entries are ignored.
运行级别域里可能包括多个运行级别。如123表示命令将在运行级别1,2,3中被启动。在ondemand条目中,运行级别中可以包括A,B,C。在sysinit,boot和bootwait的条目中,运行级别被忽略。
When the system runlevel is changed, any running processes that are not specified for the new runlevel are killed, first with SIGTERM, then with SIGKILL.
当改变系统的运行级别时,在新的运行级别中没有的所有命令将被杀死,先发送SIGTERM,然后再发送SIGKILL。
Valid actions for the action field are:
动作域中包括的有效的动作有:
respawn The process will be restarted whenever it terminates (e.g. getty).
Respawn 当终止时,程序将重启(如getty)
wait The process will be started once when the specified runlevel is entered and init will wait for its termination.Wait
当进入特定的运行级别时,程序将启动,并将init将等待其结果,然后再处理/etc/inittab中的下一个登记项
once The process will be executed once when the specified runlevel is entered.
Once如果进程没启动则启动。如果已启动,继续处理/etc/inittab中的下一个登记项
boot The process will be executed during system boot. The runlevels field is ignored.
boot:只有在引导过程中,才执行该进程;不等待进程结束,运行级别域被忽略。
bootwait The process will be executed during system boot, while init waits for its termination (e.g. /etc/rc). The runlevels field is ignored.
bootwait:只有在引导过程中,才执行该进程;等待进程结束(如/etc/rc),运行级别域被忽略。
off This does nothing.
Off:空
ondemand A process marked with an ondemand runlevel will be executed whenever the specified ondemand runlevel is called. However, no runlevel change will occur (ondemand runlevels are ‘a’, ‘b’, and ‘c’).
Ondemand:执行具有ondemand运行级别标志的进程,不论特定的运行级别,但不会改变运行级别(ondemand的运行级别包括a,b,c)
initdefault An initdefault entry specifies the runlevel which should be entered after system boot. If none exists, init will ask for a runlevel on the console. The process field is ignored.
Initdefault:表明这是一个系统启动后将进入的运行级别。如果该条目不存在,则init会在控制台提示输入运行级别,命令域被忽略。
sysinit The process will be executed during system boot. It will be exe‐ cuted before any boot or bootwait entries. The runlevels field is ignored.
Sysinit:该命令在系统启动时执行,其执行顺序在所有的boot或bootwait条目之前。运行级别域将被忽略。
powerwait The process will be executed when the power goes down. Init is usually informed about this by a process talking to a UPS connected to the computer. Init will wait for the process to finish before continuing.
Powerwait该命令将在电源关闭时运行。Init通常用命令通知UPS,init将等待命令结束。
Powerfail As for powerwait, except that init does not wait for the pro‐ cess’s completion.
Powerfail:与powerwait一样,但不等待命令结束
powerokwait This process will be executed as soon as init is informormed that the power has been restored.
Powerokwait:Init收到电源恢复后将立即执行的命令。
powerfailnow This process will be executed when init is told that the battery of the external UPS is almost empty and the power is failing (provided that the external UPS and the monitoring process are able to detect this condition).
Init收到外接UPS电池将耗尽时将执行的命令(外接UPS及监控程序将检测到这一条件)
ctrlaltdel The process will be executed when init receives the SIGINT sig‐ nal. This means that someone on the system console has pressed the CTRL-ALT-DEL key combination. Typically one wants to execute some sort of shutdown either to get into single-user level or to reboot the machine.
在控制台同时按下ctrl+alt+del时,将执行的命令,通常是某人执行shutdown进入单人模式或重启
kbrequest The process will be executed when init receives a signal from the keyboard handler that a special key combination was pressed on the console keyboard.
特定组合键被按下时执行的命令。
The documentation for this function is not complete yet; more documentation can be found in the kbd-x.xx packages (most recent was kbd-0.94 at the time of this writing). Basically you want to map some keyboard combination to the "KeyboardSignal" action. For example, to map Alt-Uparrow for this purpose use the follow‐ ing in your keymaps file:
本文档对该功能并未详细解释。更多文档在kdb-x.xx包中(最新包为kbd-0.94)中可能找到。通常,你希望映射一些组合键到“KeySignal”动作中。比如,映射alt+向上方向键可以用以下文件:
alt keycode 103 = KeyboardSignalEXAMPLES
This is an example of a inittab which resembles the old Linux inittab:
举例:
# inittab for linux
id:1:initdefault:
rc::bootwait:/etc/rc
1:1:respawn:/etc/getty 9600 tty1
2:1:respawn:/etc/getty 9600 tty2
3:1:respawn:/etc/getty 9600 tty3
4:1:respawn:/etc/getty 9600 tty4
This inittab file executes /etc/rc during boot and starts gettys on tty1-tty4.
该inittab文件将使计算机在启动时运行/etc/rc命令,并且在tty1-4上启动gettys。
A more elaborate inittab with different runlevels (see the comments inside):
一个更为复杂的例子:
# Level to run in
id:2:initdefault:
启动进入运行级别2
#Boot-time system configuration/initialization script.
si::sysinit:/etc/init.d/rcS
启动执行系统配置/初始化脚本
# What to do in single-user mode.
~:S:wait:/sbin/sulogin在单人模式下将运行sulogin
# /etc/init.d executes the S and K scripts upon change of runlevel.
#根据不同的运行级别执行不同的S,K脚本(S脚本表示执行,K脚本表示杀死,S及K后的序号表示执行顺序)
# Runlevel 0 is halt.关机
# Runlevel 1 is single-user.单人模式
# Runlevels 2-5 are multi-user.多人模式,其中2为多用户但无NFS,3为文件界面的多用户模式,4为系统保留,5为X11的X-Window图形界面的多用户模式
# Runlevel 6 is reboot.重启
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# What to do at the "3 finger salute".
ca::ctrlaltdel:/sbin/shutdown -t1 -h nowctrl+alt+del按下将关机
# Runlevel 2,3: getty on virtual consoles
# Runlevel 3: getty on terminal (ttyS0) and modem (ttyS1)

1:23:respawn:/sbin/getty tty1 VC linux
2:23:respawn:/sbin/getty tty2 VC linux
3:23:respawn:/sbin/getty tty3 VC linux
4:23:respawn:/sbin/getty tty4 VC linux
S0:3:respawn:/sbin/getty -L 9600 ttyS0 vt320
S1:3:respawn:/sbin/mgetty -x0 -D ttyS1

FILES /etc/inittab
AUTHOR Init was written by Miquel van Smoorenburg (miquels@cistron.nl). This manual page was written by Sebastian Lederer (lederer@francium.infor‐ matik.uni-bonn.de) and modified by Michael Haardt (u31b3hs@pool.infor‐ matik.rwth-aachen.de).
作者:Init作者为Miquel van Smoorenburg (miquels@cistron.nl),本文档作者为Sebastian Lederer (lederer@francium.infor‐matik.uni-bonn.de),Michael Haardt (u31b3hs@pool.infor‐matik.rwth-aachen.de)修改.
SEE ALSO init(8), telinit(8)

Dec 4, 2001 INITTAB(5)


页首
 用户资料  
 
2 楼 
 文章标题 :
帖子发表于 : 2006-11-05 19:39 
论坛管理员

注册: 2005-03-27 0:06
帖子: 10116
系统: Ubuntu 12.04
送出感谢: 7
接收感谢: 128
呵呵,如果可以直接在wiki上出现就更加好了,无论如何,还是谢谢。开通blog.


页首
 用户资料  
 
3 楼 
 文章标题 : 谢谢版主
帖子发表于 : 2006-11-05 20:04 

注册: 2006-10-02 0:40
帖子: 14
送出感谢: 0 次
接收感谢: 0 次
我的博客已经开通了,谢谢版主.
欢迎大家到我的博客做客


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 3 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 1 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译