리눅스 etc/initab 설명
- Operating System
- 2010. 1. 13.
리눅스가 실행되면 /etc/inittab 파일을 읽어들이게 됩니다.
여기에 설정된 부분들에 대해서 시스템이 영향을 받게되겠죠...
아래는 센트오에스에서 쳐본 것입니다.
5.3 버전입니다.
[root@localhost ~]# cat /etc/inittab
#
# inittab This file describes how the INIT process should set up
# the system in a certain run-level.
#
# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
# 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)
#
id:5:initdefault:
런레벨을 정의하는 것인데... 기본은 그래픽 모드( 5 )로 되어 있네요.. 텍스트 모드로 하고 싶다면...
3 으로 변경하면 되겠네요.
itialization.
si::sysinit:/etc/rc.d/rc.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
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6
런레벨에 따라서 실행되는 스크립트 인데... 여기선 etc/rc.d/rc 5 이게 실행되겠네요..
아래를 펼쳐보면 굵은 글씨로 rc.local 이 보입니다.
이 파일은 부팅 시 실행될 스크립트를 넣을 때 자주사용 됩니다.
more..
[root@localhost rc5.d]# ll
total 280
lrwxrwxrwx 1 root root 17 Aug 27 23:18 K01dnsmasq -> ../init.d/dnsmasq
lrwxrwxrwx 1 root root 24 Aug 27 23:22 K02NetworkManager -> ../init.d/NetworkManager
lrwxrwxrwx 1 root root 24 Aug 27 23:22 K02avahi-dnsconfd -> ../init.d/avahi-dnsconfd
lrwxrwxrwx 1 root root 17 Aug 27 23:22 K02oddjobd -> ../init.d/oddjobd
lrwxrwxrwx 1 root root 16 Aug 27 23:19 K05conman -> ../init.d/conman
lrwxrwxrwx 1 root root 19 Aug 27 23:18 K05saslauthd -> ../init.d/saslauthd
lrwxrwxrwx 1 root root 17 Aug 27 23:19 K05wdaemon -> ../init.d/wdaemon
lrwxrwxrwx 1 root root 16 Aug 27 23:19 K10psacct -> ../init.d/psacct
lrwxrwxrwx 1 root root 15 Aug 27 23:18 K15httpd -> ../init.d/httpd
lrwxrwxrwx 1 root root 13 Aug 27 23:19 K20nfs -> ../init.d/nfs
lrwxrwxrwx 1 root root 14 Aug 27 23:19 K24irda -> ../init.d/irda
lrwxrwxrwx 1 root root 19 Aug 27 23:23 K35vncserver -> ../init.d/vncserver
lrwxrwxrwx 1 root root 17 Aug 27 23:31 K35winbind -> ../init.d/winbind
lrwxrwxrwx 1 root root 16 Aug 27 23:16 K50ibmasm -> ../init.d/ibmasm
lrwxrwxrwx 1 root root 20 Aug 27 23:18 K50netconsole -> ../init.d/netconsole
lrwxrwxrwx 1 root root 20 Aug 27 23:19 K69rpcsvcgssd -> ../init.d/rpcsvcgssd
lrwxrwxrwx 1 root root 16 Aug 27 23:31 K73ypbind -> ../init.d/ypbind
lrwxrwxrwx 1 root root 14 Aug 27 23:18 K74nscd -> ../init.d/nscd
lrwxrwxrwx 1 root root 14 Aug 27 23:39 K74ntpd -> ../init.d/ntpd
lrwxrwxrwx 1 root root 15 Aug 27 23:19 K85mdmpd -> ../init.d/mdmpd
lrwxrwxrwx 1 root root 20 Aug 27 23:17 K87multipathd -> ../init.d/multipathd
lrwxrwxrwx 1 root root 24 Aug 27 23:22 K88wpa_supplicant -> ../init.d/wpa_supplicant
lrwxrwxrwx 1 root root 14 Aug 27 23:23 K89dund -> ../init.d/dund
lrwxrwxrwx 1 root root 18 Aug 27 23:17 K89netplugd -> ../init.d/netplugd
lrwxrwxrwx 1 root root 14 Aug 27 23:23 K89pand -> ../init.d/pand
lrwxrwxrwx 1 root root 15 Aug 27 23:16 K89rdisc -> ../init.d/rdisc
lrwxrwxrwx 1 root root 14 Aug 27 23:21 K91capi -> ../init.d/capi
lrwxrwxrwx 1 root root 23 Aug 27 23:19 S00microcode_ctl -> ../init.d/microcode_ctl
lrwxrwxrwx 1 root root 22 Aug 27 23:19 S02lvm2-monitor -> ../init.d/lvm2-monitor
lrwxrwxrwx 1 root root 25 Aug 27 23:19 S04readahead_early -> ../init.d/readahead_early
lrwxrwxrwx 1 root root 15 Aug 27 23:22 S05kudzu -> ../init.d/kudzu
lrwxrwxrwx 1 root root 18 Aug 27 23:16 S06cpuspeed -> ../init.d/cpuspeed
lrwxrwxrwx 1 root root 19 Aug 27 23:16 S08ip6tables -> ../init.d/ip6tables
lrwxrwxrwx 1 root root 18 Aug 27 23:16 S08iptables -> ../init.d/iptables
lrwxrwxrwx 1 root root 18 Aug 27 23:18 S08mcstrans -> ../init.d/mcstrans
lrwxrwxrwx 1 root root 14 Aug 27 23:21 S09isdn -> ../init.d/isdn
lrwxrwxrwx 1 root root 17 Aug 27 23:18 S10network -> ../init.d/network
lrwxrwxrwx 1 root root 16 Aug 27 23:18 S11auditd -> ../init.d/auditd
lrwxrwxrwx 1 root root 21 Aug 27 23:19 S12restorecond -> ../init.d/restorecond
lrwxrwxrwx 1 root root 16 Aug 27 23:18 S12syslog -> ../init.d/syslog
lrwxrwxrwx 1 root root 20 Aug 27 23:19 S13irqbalance -> ../init.d/irqbalance
lrwxrwxrwx 1 root root 17 Aug 27 23:18 S13portmap -> ../init.d/portmap
lrwxrwxrwx 1 root root 17 Aug 27 23:19 S14nfslock -> ../init.d/nfslock
lrwxrwxrwx 1 root root 19 Aug 27 23:19 S15mdmonitor -> ../init.d/mdmonitor
lrwxrwxrwx 1 root root 19 Aug 27 23:19 S18rpcidmapd -> ../init.d/rpcidmapd
lrwxrwxrwx 1 root root 17 Aug 27 23:19 S19rpcgssd -> ../init.d/rpcgssd
lrwxrwxrwx 1 root root 20 Aug 27 23:22 S22messagebus -> ../init.d/messagebus
lrwxrwxrwx 1 root root 19 Aug 27 23:23 S25bluetooth -> ../init.d/bluetooth
lrwxrwxrwx 1 root root 15 Aug 27 23:18 S25netfs -> ../init.d/netfs
lrwxrwxrwx 1 root root 15 Aug 27 23:22 S25pcscd -> ../init.d/pcscd
lrwxrwxrwx 1 root root 14 Aug 27 23:23 S26apmd -> ../init.d/apmd
lrwxrwxrwx 1 root root 14 Aug 27 23:23 S26hidd -> ../init.d/hidd
lrwxrwxrwx 1 root root 16 Aug 27 23:19 S28autofs -> ../init.d/autofs
lrwxrwxrwx 1 root root 15 Aug 27 23:19 S44acpid -> ../init.d/acpid
lrwxrwxrwx 1 root root 15 Aug 27 23:19 S50hplip -> ../init.d/hplip
lrwxrwxrwx 1 root root 14 Aug 27 23:19 S55sshd -> ../init.d/sshd
lrwxrwxrwx 1 root root 14 Aug 27 23:22 S56cups -> ../init.d/cups
lrwxrwxrwx 1 root root 18 Aug 27 23:18 S80sendmail -> ../init.d/sendmail
lrwxrwxrwx 1 root root 13 Aug 27 23:16 S85gpm -> ../init.d/gpm
lrwxrwxrwx 1 root root 15 Aug 27 23:18 S90crond -> ../init.d/crond
lrwxrwxrwx 1 root root 13 Aug 27 23:22 S90xfs -> ../init.d/xfs
lrwxrwxrwx 1 root root 17 Aug 27 23:17 S95anacron -> ../init.d/anacron
lrwxrwxrwx 1 root root 13 Aug 27 23:18 S95atd -> ../init.d/atd
lrwxrwxrwx 1 root root 25 Aug 27 23:19 S96readahead_later -> ../init.d/readahead_later
lrwxrwxrwx 1 root root 22 Aug 27 23:23 S97yum-updatesd -> ../init.d/yum-updatesd
lrwxrwxrwx 1 root root 22 Aug 27 23:22 S98avahi-daemon -> ../init.d/avahi-daemon
lrwxrwxrwx 1 root root 19 Aug 27 23:22 S98haldaemon -> ../init.d/haldaemon
lrwxrwxrwx 1 root root 19 Aug 27 23:23 S99firstboot -> ../init.d/firstboot
lrwxrwxrwx 1 root root 11 Aug 27 23:18 S99local -> ../rc.local
lrwxrwxrwx 1 root root 16 Aug 27 23:19 S99smartd -> ../init.d/smartd
[root@localhost rc5.d]#
# 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"
# 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
# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon
[root@localhost ~]#