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

📄 inittab.5

📁 sysvinit--linux系统下的init
💻 5
字号:
.\"{{{}}}.\"{{{  Title.TH INITTAB 5 "Dec 4, 2001" "" "Linux System Administrator's Manual".\"}}}.\"{{{  Name.SH NAMEinittab \- format of the inittab file used by the sysv-compatible initprocess.\"}}}.\"{{{  Description.SH DESCRIPTIONThe \fBinittab\fP file describes which processes are started at bootup andduring normal operation (e.g.\& /etc/init.d/boot, /etc/init.d/rc, gettys...)..BR Init (8)distinguishes multiple \fIrunlevels\fP, each of which can have its own set ofprocesses that are started.  Valid runlevels are \fB0\fP\-\fB6\fP plus\fBA\fP, \fBB\fP, and \fBC\fP for \fBondemand\fP entries.  An entry in the\fBinittab\fP file has the following format:.RS.sp\fIid\fP:\fIrunlevels\fP:\fIaction\fP:\fIprocess\fP.sp.RELines beginning with `#' are ignored..\"{{{  id.IP \fIid\fPis a unique sequence of 1-4 characters which identifies an entry in.B inittab (for versions of sysvinit compiled with the \fIold\fP libc5 (< 5.2.18) ora.out libraries the limit is 2 characters)..spNote: traditionally, for getty and other login processes, the value of the\fIid\fP field is kept the same as the suffix of the corresponding tty, e.g.\&\fB1\fP for \fBtty1\fP. Some ancient login accounting programs mightexpect this, though I can't think of any..\"}}}.\"{{{  runlevels.IP \fIrunlevels\fPlists the runlevels for which the specified action should be taken..\"}}}.\"{{{  action.IP \fIaction\fPdescribes which action should be taken..\"}}}.\"{{{  process.IP \fIprocess\fPspecifies the process to be executed.  If the process field starts witha `+' character, .B 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..\"}}}.PPThe \fIrunlevels\fP field may contain multiple characters for differentrunlevels.  For example, \fB123\fP specifies that the process should be started in runlevels 1, 2, and 3.The \fIrunlevels\fP for \fBondemand\fP entries may contain an \fBA\fP,\fBB\fP, or \fBC\fP.  The \fIrunlevels\fP field of \fBsysinit\fP,\fBboot\fP, and \fBbootwait\fP entries are ignored..PPWhen the system runlevel is changed, any running processes that are notspecified for the new runlevel are killed, first with \s-2SIGTERM\s0,then with \s-2SIGKILL\s0..PPValid actions for the \fIaction\fP field are:.\"{{{  respawn.IP \fBrespawn\fPThe process will be restarted whenever it terminates (e.g.\& getty)..\"}}}.\"{{{  wait.IP \fBwait\fPThe process will be started once when the specified runlevel is entered and .B init will wait for its termination..\"}}}.\"{{{  once.IP \fBonce\fPThe process will be executed once when the specified runlevel isentered..\"}}}.\"{{{  boot.IP \fBboot\fPThe process will be executed during system boot.  The \fIrunlevels\fPfield is ignored..\"}}}.\"{{{  bootwait.IP \fBbootwait\fPThe process will be executed during system boot, while .B init waits for its termination (e.g.\& /etc/rc).  The \fIrunlevels\fP field is ignored..\"}}}.\"{{{  off.IP \fBoff\fPThis does nothing..\"}}}.\"{{{  ondemand.IP \fBondemand\fPA process marked with an \fBondemand\fP runlevel will be executedwhenever the specified \fBondemand\fP runlevel is called.  However, norunlevel change will occur (\fBondemand\fP runlevels are `a', `b',and `c')..\"}}}.\"{{{  initdefault.IP \fBinitdefault\fPAn \fBinitdefault\fP entry specifies the runlevel which should beentered after system boot.  If none exists, .B initwill ask for a runlevel on the console. The \fIprocess\fP field is ignored..\"}}}.\"{{{  sysinit.IP \fBsysinit\fPThe process will be executed during system boot. It will beexecuted before any \fBboot\fP or \fB bootwait\fP entries.The \fIrunlevels\fP field is ignored..\"}}}.\"{{{  powerwait.IP \fBpowerwait\fPThe process will be executed when the power goes down. Init is usuallyinformed about this by a process talking to a UPS connected to the computer.\fBInit\fP will wait for the process to finish before continuing..\"}}}.\"{{{  powerfail.IP \fBpowerfail\fPAs for \fBpowerwait\fP, except that \fBinit\fP does not wait for the process'scompletion..\"}}}.\"{{{  powerokwait.IP \fBpowerokwait\fPThis process will be executed as soon as \fBinit\fP is informormed that thepower has been restored..\"}}}.\"{{{  powerfailnow.IP \fBpowerfailnow\fPThis process will be executed when \fBinit\fP is told that the battery ofthe external UPS is almost empty and the power is failing (provided that theexternal UPS and the monitoring process are able to detect this condition)..\"}}}.\"{{{  ctrlaltdel.IP \fBctrlaltdel\fPThe process will be executed when \fBinit\fP receives the SIGINT signal.This means that someone on the system console has pressed the\fBCTRL\-ALT\-DEL\fP key combination. Typically one wants to execute somesort of \fBshutdown\fP either to get into single\-user level or toreboot the machine..\"}}}.\"{{{  kbrequest.IP \fBkbrequest\fPThe process will be executed when \fBinit\fP receives a signal from thekeyboard handler that a special key combination was pressed on theconsole keyboard..spThe documentation for this function is not complete yet; more documentationcan be found in the kbd-x.xx packages (most recent was kbd-0.94 atthe time of this writing). Basically you want to map some keyboardcombination to the "KeyboardSignal" action. For example, to map Alt-Uparrowfor this purpose use the following in your keymaps file:.RS.spalt keycode 103 = KeyboardSignal.sp.RE.\"}}}.\"}}}.\"{{{  Examples.SH EXAMPLESThis is an example of a inittab which resembles the old Linux inittab:.RS.sp.nf.ne 7# inittab for linuxid:1:initdefault:rc::bootwait:/etc/rc1:1:respawn:/etc/getty 9600 tty12:1:respawn:/etc/getty 9600 tty23:1:respawn:/etc/getty 9600 tty34:1:respawn:/etc/getty 9600 tty4.fi.sp.REThis inittab file executes \fB/etc/rc\fP during boot and starts gettyson tty1\-tty4..PPA more elaborate \fBinittab\fP with different runlevels (see the commentsinside):.RS.sp.nf.ne 19# Level to run inid:2:initdefault:# Boot-time system configuration/initialization script.si::sysinit:/etc/init.d/rcS# What to do in single-user mode.~:S:wait:/sbin/sulogin# /etc/init.d executes the S and K scripts upon change# of runlevel.## Runlevel 0 is halt.# Runlevel 1 is single-user.# Runlevels 2-5 are multi-user.# Runlevel 6 is reboot.l0:0:wait:/etc/init.d/rc 0l1:1:wait:/etc/init.d/rc 1l2:2:wait:/etc/init.d/rc 2l3:3:wait:/etc/init.d/rc 3l4:4:wait:/etc/init.d/rc 4l5:5:wait:/etc/init.d/rc 5l6:6:wait:/etc/init.d/rc 6# What to do at the "3 finger salute".ca::ctrlaltdel:/sbin/shutdown -t1 -h now# Runlevel 2,3: getty on virtual consoles# Runlevel   3: getty on terminal (ttyS0) and modem (ttyS1)1:23:respawn:/sbin/getty tty1 VC linux2:23:respawn:/sbin/getty tty2 VC linux3:23:respawn:/sbin/getty tty3 VC linux4:23:respawn:/sbin/getty tty4 VC linuxS0:3:respawn:/sbin/getty -L 9600 ttyS0 vt320S1:3:respawn:/sbin/mgetty -x0 -D ttyS1.fi.sp.RE.\"}}}.\"{{{  Files.SH FILES/etc/inittab.\"}}}.\"{{{  Author.SH AUTHOR\fBInit\fP was written by Miquel van Smoorenburg (miquels@cistron.nl).  This manual page was written by Sebastian Lederer (lederer@francium.informatik.uni-bonn.de) and modifiedby Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de)..\"}}}.\"{{{  See also.SH "SEE ALSO".BR init (8),.BR telinit (8).\"}}}

⌨️ 快捷键说明

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