Linux Run Level
RunLevel 0 : 시스템 종료(halt)
RunLevel 1 : 단일 사용자, 싱글 모드
RunLevel 2 : NFS를 지원하지 않는 다중 사용자 모드
RunLevel 3 : 모든 기능을 포함한 다중 사용자 모드(X윈도우 지원안함)
RunLevel 4 : 사용되지 않는 실행모드(사용자가 직접정의하여 사용)
RunLevel 5 : X윈도우 부팅, GUI환경
RunLevel 6 : 시스템 재부팅
RunLevel 3이라면 /etc/rc.d/rc3.d 디렉토리에 있는 심볼릭 링크 스크립트(실제 스크립트 파일은 /etc/rc.d/init.d 디렉토리에 있음)를 실행함.
init 명령어를 사용하여 RunLevel을 전환 할수 있다.
[root@localhost ~]# init 3 |
기본적으로 부팅되는 RunLevel을 변경하기 위해서는 /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: # 부팅시 기본적으로 적용되는 RunLevel
# 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
|
실행 레벨 설정 (chkconfig 명령어)
[root@localhost ~]# chkconfig --list |
모든 데몬들의 실행 레벨을 확인
[root@localhost ~]# chkconfig --list httpd |
httpd 데몬의 실행 레벨을 확인
[root@localhost ~]# chkconfig --level 2345 httpd on |
httpd 데몬의 실행 레벨 2,3,4,5 번 활성화 시킴
Linux Root 계정의 PassWord를 잊어버렸을 경우 Linux 부팅시 RunLevel 1로 전환 후 부팅을 하면
Linux 부팅후 로그인 과정 없이 접속할수 있다.
Linux 를 부팅시 커널 버전을 선택할수 있는 Grub 화면이 뜨면
부팅 하고자 하는 커널 버전을 선택한후 'e'를 입력하면
RunLevel을 수정할수 있는 화면이 나온다..
kernel /vmlinuz-2.6.9-34.EL ro root=LABEL=/ 1
여기서 위와 같이 "root=LABEL=/" 뒤에 원하는 RunLevel "1"을 추가한후 부팅하면 된다 |