Linux
[Linux] shutdown, reboot 명령어
밝은숲
2020. 3. 16. 13:23
1. shutdown
- Linux를 종료할 때 사용
- halt : 모든 프로세스를 중지시키지만 전원은 차단하지 않음
- shutdown : 모든 프로세스 중지 및 전원을 차단함
-H | --halt | Halt the machine | 모든 프로세스 중지 |
-P | --poweroff | Power-off the machine | 전원 종료 |
-r | --reboot | Reboot the machine | 재부팅 |
-h | Equivalent to --poweroff, overridden by --halt | shutdown 완료 후 시스템 종료 | |
-k | Don't halt/power-off/reboot, just send warnings | 경고 메시지만 출력, 실제 shutdown 안 함 | |
-c | Cancel a pending shutdown | 진행(예약)된 shutdown 취소 |
(1) 10분 후에 종료
# shutdown -h 10
# shutdown -P +10
# shutdown 10
(2) 지금 종료
# shutdown -h now
(3) 5분 후, 20시, 지금 재부팅
# shutdown -r 5
# shutdown -r 20:00
# shutdown -r now
(4) 10분 후 사용자에게 종료된다고 메시지 보내기(실제 종료되진 않음)
# shutdown -k +10
2. reboot
-p | poweroff, 시스템 종료 |
-f | force, 시스템 강제 재부팅 |
-w | 시스템 종료 및 재부팅하지 않고 관련 정보만 /var/log/wtmp에 저장 |
(1) 시스템종료
# reboot -p
(2) 즉시 시스템 재부팅
# reboot
(3) 강제 시스템 재부팅
# reboot -f
* Default RunLevel
- 리눅스 시스템이 가동되는 방법
- 7가지 런레벨이 있음
init 0 | 종료 |
init 1 | 단일 사용자 모드(시스템 복구 시 사용) |
init 2 | NFS 없는 다중 사용자 모드 |
init 3 | 텍스트 모드의 다중 사용자 모드 |
init 4 | 사용하지 않음 |
init 5 | X 윈도우 모드의 다중 사용자 모드 |
init 6 | 재부팅 모드 |