reboot 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-reboot
핵심 정리
- 시스템을 바로 다시 시작합니다. 다른 사용자가 로그인해 있지 않을 때 쓰며, 사용자가 있으면
shutdown -r을 씁니다. reboot는sync로 디스크를 맞추고 재부팅하지만 응용 프로그램을 차례로 멈추거나/etc/rc.shutdown을 실행하지는 않습니다. 운영 서버는shutdown -Fr이 더 안전합니다.-q는 프로세스를 멈추지도sync도 하지 않고,-n은sync를 하지 않아 파일 시스템이 손상될 수 있습니다.- 시스템이 멈춘 뒤 자동으로 다시 켜질지는
sys0의autorestart속성(lsattr -El sys0 -a autorestart)으로 정합니다. fastboot는reboot를 부르는 BSD 호환 이름입니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1에서 -t의 두 자리 연도 해석이 더해짐. 6.1 문서의 설명 절은 일부가 빠져 있어 5.3 문서로 보충함) |
| 원문 | IBM Commands Reference — 5.3 Volume 4, 6.1 Volume 2 |
| 파일 | /usr/sbin/reboot, /etc/rc, /var/adm/wtmp |
| 관련 명령어 | shutdown, halt, sync, chdev, lsattr |
목적
시스템을 다시 시작합니다.
영어 원문
Restarts the system.
구문
{ reboot | fastboot } [ -l ] [ -n ] [ -q ] [ -t mmddHHMM [ yy ] ]
설명
reboot 명령은 다른 사용자가 시스템에 로그인해 있지 않을 때 재부팅에 씁니다. 시스템이 실행 중이고 여러 사용자가 로그인해 있으면 shutdown 명령을 씁니다. 두 명령 모두 시스템을 일부러 잠시 멈췄다는 항목을 오류 로그에 씁니다.
reboot는 sync 명령으로 디스크를 맞추고, 하드웨어 시각 시계를 다시 맞추는 등 다른 종료 작업을 한 뒤 재부팅을 시작합니다. 기본으로 시스템이 시작되면서 디스크를 자동으로 검사하고, 성공하면 기본 실행 수준으로 올라옵니다.
강제로 재부팅하려면 시스템 종류에 따라 재부팅용으로 예약된 키를 누릅니다. 그래도 안 되면 전원을 끄고 디스크가 멈추도록 60초 이상 기다린 뒤 다시 켭니다.
autorestart 속성이 true면 전원을 켤 때나 시스템이 멈춘 뒤 스스로 다시 시작합니다. 값은 lsattr -D -l sys0으로 보며 기본 true입니다. false로 바꾸려면 chdev -l sys0 -a autorestart=false를 실행합니다.
진단 검사 뒤 시스템 ROM은 부트스트랩 레코드를 찾을 때까지 반복합니다. 보통 부트스트랩 레코드가 디스켓이나 고정 디스크에서 부트 프로그램을 읽습니다. 커널에 디버거를 구성했으면 디버거로 먼저 들어가지만, 30초쯤 아무것도 입력하지 않으면 자동으로 계속(go)하며, Enter를 눌러도 계속합니다.
reboot는 보통 syslog로 재부팅을 기록하고 로그인 계정 파일 /var/adm/wtmp에 종료 레코드를 넣습니다. -l, -n, -q를 주면 이 동작을 하지 않습니다.
fastboot 명령은 reboot를 불러 시스템을 다시 시작합니다. 시스템이 시작될 때 fsck가 파일 시스템을 검사합니다. BSD 호환용 명령입니다.
참고: 6.1 문서의 이 절은 문단 일부가 빠진 채로 실려 있어, 위 번역은 5.3 문서의 설명을 따랐습니다.
영어 원문
The reboot command can be used to perform a reboot operation if no other users are logged into the system. The lsattr command and enter lsattr -D -l sys0. The default value is true. To reset the autorestart attribute value to false, use the /var/adm/wtmp, the login accounting file. These actions are inhibited if the -l, -n, or -q flags are present.
The fastboot command restarts the system by calling the reboot command. The fsck command runs during system startup to check file systems. This command provides BSD compatibility.
플래그
| 플래그 | 설명 |
|---|---|
-l |
재부팅을 기록하지 않고 계정 파일에 종료 레코드를 넣지 않습니다. 계정 파일 갱신 자체는 막지 않습니다. -n, -q는 -l을 포함합니다. |
-n |
sync 명령을 하지 않습니다. 파일 시스템이 손상될 수 있습니다. |
-q |
실행 중인 프로세스를 먼저 멈추지 않고 다시 시작합니다. 파일 시스템 동기화도 하지 않으므로, 동기화하려면 직접 sync를 실행하거나 shutdown -r을 씁니다. |
-t mmddHHMM [ yy ] |
바로 종료하고 지정한 날짜에 다시 시작합니다. mm은 월, dd는 일, HH는 시, MM은 분, yy는 연도(선택)입니다. (6.1) 두 자리 연도는 시스템 시각 기준 현재 세기의 연도로 해석합니다. 예를 들어 지금이 1985년이면 99는 1999년이고, 지금이 2005년이면 99는 2099년, 04는 2004년입니다. |
영어 원문
-l— Does not log the reboot or place a shutdown record in the accounting file. The-lflag does not suppress accounting file update. The-nand-qflags imply-l.-n— Does not perform the sync command. Use of this flag can cause file system damage.-q— Restarts without first shutting down running processes. Note: A file system synchronization will not occur if the-qflag is used. If you want the file system to be synchronized, manually run the sync command or use the shutdown -r command.-t— Shuts down the system immediately and then restarts the system on the specified date. A valid date has the following format: mmddHHMM [ yy ] where: mm Specifies the month. dd Specifies the day. HH Specifies the hour. MM Specifies the minute. yy Specifies the year (optional). The two digit value represents the value of the year in the current century (based on the system time). For example, if the current year based on the systems time is 1985, 99 means 1999 and if the current year is 2005 then 99 means 2099 and 04 means 2004.
보안
(6.1) RBAC와 Trusted AIX 사용자: 이 명령은 특권 작업을 할 수 있으며 특권 사용자만 할 수 있습니다. 권한과 특권은 lssecattr 명령이나 getcmdattr 하위 명령으로 봅니다.
영어 원문
Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.
예제
재부팅을 기록하지 않고 시스템을 다시 시작합니다.
reboot -l
자주 쓰는 형태:
who # 로그인한 사용자 확인
sync; sync; reboot
lsattr -El sys0 -a autorestart # 멈춘 뒤 자동 재시작 여부
영어 원문
To shut down the system without logging the reboot, enter:
reboot -l
파일
| 파일 | 설명 |
|---|---|
/etc/rc |
시스템 시작 스크립트 |
/var/adm/wtmp |
로그인 계정 파일 |
영어 원문
- /etc/rc — Specifies the system startup script.
- /var/adm/wtmp — Specifies login accounting file.
리눅스(GNU)와 다른 점
리눅스에서 부트 이미지는 dracut·mkinitramfs로 만드는 initramfs와 GRUB 설정(grub2-mkconfig, grub2-install)이고, 부팅 순서는 UEFI의 efibootmgr로 바꿉니다. 종료와 재시작은 shutdown -h now, shutdown -r now, systemctl poweroff, systemctl reboot입니다. 리눅스 reboot는 systemd에서 systemctl reboot와 같으며, reboot -f는 서비스를 정리하지 않고 바로 재시작합니다.