复制代码代码如下: # The default runlevel. id:2:initdefault: #表示当前缺省运行级别为2
复制代码代码如下: # Boot-time system configuration/initialization script. # This is run first except when booting in emergency (-b) mode. 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 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 # Normally not reached, but fallthrough in case of emergency. z6:6:respawn:/sbin/sulogin
复制代码代码如下: # What to do when CTRL-ALT-DEL is pressed. #在启动过程中是否允许按CTRL-ALT-DELETE重启系统 #ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
复制代码代码如下: # Action on special keypress (ALT-UpArrow). #kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work."
复制代码代码如下: # What to do when the power fails/returns. pf::powerwait:/etc/init.d/powerfail start pn::powerfailnow:/etc/init.d/powerfail now po::powerokwait:/etc/init.d/powerfail stop
复制代码代码如下: # /sbin/getty invocations for the runlevels. # # The "id" field MUST be the same as the last # characters of the device (after "tty"). # # Format: #<id>:<runlevels>:<action>:<process> # # Note that on most Debian systems tty7 is used by the X Window System, # so if you want to add more getty"s go ahead but skip tty7 if you run X. # getty进程来提供虚拟终端设备的服务 1:2345:respawn:/sbin/getty 38400 tty1
复制代码代码如下: #标签字段的值是1,1是设备tty1的数字后缀,tty1与相应的进程相关联,该getty进程可以启动的runlevel是2,3,4和5,当该进程终止时,init马上就重新启动它。启动进程的路径名是/sbin/getty,该进程是实现虚拟终端支持的最小版本的getty,为tty1提供启动虚拟设备的进程。 2:23:respawn:/sbin/getty 38400 tty2 #3:23:respawn:/sbin/getty 38400 tty3 #4:23:respawn:/sbin/getty 38400 tty4 #5:23:respawn:/sbin/getty 38400 tty5 #6:23:respawn:/sbin/getty 38400 tty6 # Example how to put a getty on a serial line (for a terminal) # #T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100 T1:23:respawn:/sbin/getty -L ttyS1 115200 vt100 # Example how to put a getty on a modem line. # #T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3