reboot和init 6之間的區別

tianya_2011發表於2017-02-28

Linux中重啟的兩個命令:reboot和init 6之間的區別

init命令用於改變作業系統的執行級別。
Init 6是重新啟動機器。
reboot也是重新啟動機器。
那麼這兩個命令到底有什麼區別呢?
對這兩個操作使用man命令看到的內容如下:
"init 6" 基於一系列/etc/inittab檔案,並且每個應用都會有一個相應shutdown指令碼。
'init 6' 呼叫一系列shutdown指令碼(/etc/rc0.d/K*)來使系統優雅關機;
'reboot'並不執行這些過程,reboot更是一個kernel級別的命令,不對應用使用shutdown指令碼。 .
我們應該在通常情況下使用 init 6.
reboot - reboot performs a sync(1M) operation on the disks, and then a
multi- user reboot is initiated. See init(1M) for details.
init 6 Stop the operating system and reboot to the
state defined by the initdefault entry in
/etc/inittab.
在出問題的狀況下或強制重啟時使用reboot.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25373498/viewspace-2134414/,如需轉載,請註明出處,否則將追究法律責任。

相關文章