<컴퓨터 켜고 끄기와 Run Level>

 

 

리눅스 부팅 순서
1) BIOS (Basic Input Output System)
2) Master Boot Record (MBR)
3) LILO or GRUB
4) Kernel
5) init : process number i(PID=1)
  -/linuxrc : load modules / initialize devices / exits
    -/sbin/init
    -/etc/inittab : run boot scripts
      -/etc/init.d/rcS
      -/etc/tcS.d/S* scripts
        -/etc/rc.boot/*
6) Run Levels

 



리눅스 Run Levels

 

 

ps -p 1 ef (명령어) 1번 프로세스 목록 확인
/etc/rc (디렉토리 경로) 런 레벨에 따라 실행되는 프로그램들 위치

 


 
(rc0.d ~ rcS.d 위 스샷의 런 레벨에 따라 디렉토리로 묶여있음)

 

init number 명령어를 통해 해당하는 디렉토리의 스크립트들을 실행시켜줄 수 있다


 

컴퓨터 시작과 종료 명령어



종료 방법  
$poweroff 사용자가 자신 뿐일 경우 메세지 없이 바로 종료
$shutdown 여러 사용자가 사용할 경우 메세지를 날리는 방식으로 종료해줄 수 있다
$halt 종료
$init 0 종료
halt, reboot, poweroff, telinit, and shutdown are all one program

 

shutdown 옵션  
-H --halt Halt the machine
-P --poweroff Power-off the machine
-r --reboot Reboot the machine
-h Equivalent to --poweroff, overrridden by --halt
-k Don't halt/power-off/reboot, just send warnings
--no-wall Don't send wall message before halt/power-off/reboot

 

재시작
$reboot 다른 사용자가 사용중일 때는 root 계정으로 강제 재부팅
$shutdown  
$init 6  

 

AWS 사용 안하고 직접 설치한 서버에 원격으로 접속해서 켜고 끌때는 이렇게 하면 된다

서버가 옆에 있다면 그냥 전원 버튼 눌러서 끄셈

+ Recent posts