inittab文件示例
学习啦在线学习网inittab文件示例
inittab文件示例
RHEL4
#
学习啦在线学习网 # inittab This file describes how the INIT process should set up
# the system in a certain run-level.
#
# Author: Miquel van Smoorenburg,
学习啦在线学习网 # Modified for RHS Linux by Marc Ewing and Donnie Barnes
#
# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
学习啦在线学习网 # 4 - unused
学习啦在线学习网 # 5 - X11
学习啦在线学习网 # 6 - reboot (Do NOT set initdefault to this)
#
//表示当前默认运行级别为5,启动系统进入图形化界面
id:5:initdefault:
//启动时自动执行/etc/rc.d/rc.sysinit脚本
# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit
l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
学习啦在线学习网 l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
学习啦在线学习网 //当运行级别为5时,以5为参数运行/etc/rc.d/rc脚本,init将等待其返回
学习啦在线学习网 l5:5:wait:/etc/rc.d/rc 5
学习啦在线学习网 l6:6:wait:/etc/rc.d/rc 6
学习啦在线学习网 //在启动过程中允许按[Ctrl+Alt+Del]重启系统
# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
学习啦在线学习网 # When our UPS tells us power has failed, assume we have a few minutes
# of power left. Schedule a shutdown for 2 minutes from now.
# This does, of course, assume you have powerd installed and your
学习啦在线学习网 # UPS connected and working correctly.
学习啦在线学习网 pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"
学习啦在线学习网 # If power was restored before the shutdown kicked in, cancel it.
学习啦在线学习网 pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"
//在运行级别2、3、4、5上以ttyX为参数执行/sbin/mingetty程序,打开ttyX终端用于用户登录,如果进程退出则再次运行mingetty程序
学习啦在线学习网 # Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
学习啦在线学习网 2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
学习啦在线学习网 4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
//在级别5上运行xdm程序,提供xdm图形方式登录界面,并在退出时重新执行
# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon
LFS
# Begin /etc/inittab
id:3:initdefault:
学习啦在线学习网 si::sysinit:/etc/rc.d/init.d/rc sysinit
l0:0:wait:/etc/rc.d/init.d/rc 0
l1:S1:wait:/etc/rc.d/init.d/rc 1
l2:2:wait:/etc/rc.d/init.d/rc 2
l3:3:wait:/etc/rc.d/init.d/rc 3
l4:4:wait:/etc/rc.d/init.d/rc 4
学习啦在线学习网 l5:5:wait:/etc/rc.d/init.d/rc 5
l6:6:wait:/etc/rc.d/init.d/rc 6
学习啦在线学习网 ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
学习啦在线学习网 su:S016:once:/sbin/sulogin
学习啦在线学习网 1:2345:respawn:/sbin/agetty tty1 9600
学习啦在线学习网 2:2345:respawn:/sbin/agetty tty2 9600
3:2345:respawn:/sbin/agetty tty3 9600
学习啦在线学习网 4:2345:respawn:/sbin/agetty tty4 9600
5:2345:respawn:/sbin/agetty tty5 9600
学习啦在线学习网 6:2345:respawn:/sbin/agetty tty6 9600
# End /etc/inittab