poweroff 中文man頁面
NAME
halt, reboot, poweroff - 中止系統(tǒng)運行
SYNOPSIS
/sbin/halt [-n] [-w] [-d] [-f] [-i] [-p]
/sbin/reboot [-n] [-w] [-d] [-f] [-i]
/sbin/poweroff [-n] [-w] [-d] [-f] [-i]
描述
Halt 將系統(tǒng)正在關機的信息寫入 /var/log/wtmp 文件,然后通知內核停止重啟或關機系統(tǒng)。如果 halt 或 reboot 是在系統(tǒng) 沒有 運行在運行級別 0 或 6 ,系統(tǒng)將調用 shutdown(8) 命令(使用參數(shù) -h 或 -r )。
選項
- -n
- 在關機或重啟之前不對系統(tǒng)緩存進行同步。
- -w
- 不真正重啟或關機,而僅僅將關機信息寫入 wtmp (在 /var/log/wtmp 文件里)。
- -d
- 不記錄此次關機情況。當使用 -n 參數(shù)時隱含 -d。
- -f
- 強制執(zhí)行 halt 或 reboot 而不去調用 shutdown(8)。
- -i
- 在關閉或重啟系統(tǒng)之前關閉所有網(wǎng)絡界面。
- -p
- 當關閉系統(tǒng)時執(zhí)行關閉電源操作。當以 poweroff 方式調用 halt 時,此為缺省參數(shù)。
DIAGNOSTICS
If you're not the superuser, you will get the message `must be superuser'.
注意
在先前的 sysvinit 發(fā)布中,reboot 和 halt 不能直接調用。從版本 2.74 開始,當系統(tǒng)不是運行在運行級別0或6的時侯,執(zhí)行 halt 和 reboot 后實際調用的是 shutdown(8) 。這就意味著如果在當前運行級別的環(huán)境中無法找到
halt 或 reboot 的時候(比如,在 /var/run/utmp 還沒有正確初始化的時候),將會調用 shutdown,這個結果也許非你所想。如果你想做一此硬的 halt 或 reboot,那么使用 -f 參數(shù)。
作者
Miquel van Smoorenburg, miquels@cistron.nl
參見
shutdown(8), init(1)
#p#
NAME
halt, reboot, poweroff - stop the system.
SYNOPSIS
/sbin/halt [-n] [-w] [-d] [-f] [-i] [-p] [-h]
/sbin/reboot [-n] [-w] [-d] [-f] [-i]
/sbin/poweroff [-n] [-w] [-d] [-f] [-i] [-h]
DESCRIPTION
Halt notes that the system is being brought down in the file /var/log/wtmp, and then either tells the kernel to halt, reboot or poweroff the system.
If halt or reboot is called when the system is not in runlevel 0 or 6, in other words when it's running normally, shutdown will be invoked instead (with the -h or -r flag). For more info see the shutdown(8) manpage.
The rest of this manpage describes the behaviour in runlevels 0 and 6, that is when the systems shutdown scripts are being run.
OPTIONS
- -n
- Don't sync before reboot or halt.
- -w
- Don't actually reboot or halt but only write the wtmp record (in the /var/log/wtmp file).
- -d
- Don't write the wtmp record. The -n flag implies -d.
- -f
- Force halt or reboot, don't call shutdown(8).
- -i
- Shut down all network interfaces just before halt or reboot.
- -h
- Put all harddrives on the system in standby mode just before halt or poweroff.
- -p
- When halting the system, do a poweroff. This is the default when halt is called as poweroff.
DIAGNOSTICS
If you're not the superuser, you will get the message `must be superuser'.
NOTES
Under older sysvinit releases , reboot and halt should never be called directly. From release 2.74 on halt and reboot invoke shutdown(8) if the system is not in runlevel 0 or 6. This means that if halt or reboot cannot find out the current runlevel (for example, when /var/run/utmp hasn't been initialized correctly) shutdown will be called, which might not be what you want. Use the -f flag if you want to do a hard halt or reboot.
The -h flag puts all harddisks in standby mode just before halt or poweroff. Right now this is only implemented for IDE drives. A side effect of putting the drive in standby mode is that the write cache on the disk is flushed. This is important for IDE drives, since the kernel doesn't flush the write-cache itself before poweroff.
The halt program uses /proc/ide/hd* to find all IDE disk devices, which means that /proc needs to be mounted when halt or poweroff is called or the -h switch will do nothing.
AUTHOR
Miquel van Smoorenburg, miquels@cistron.nl
SEE ALSO
shutdown(8), init(8)