Centos

Red Hat / RHEL / CentOS上的init 6和reboot有什麼區別?

  • October 23, 2017

在 Linux 中,init 6 命令先優雅地重新啟動執行所有 K* 關閉腳本的系統,然後再重新啟動。reboot 命令會非常快速地重新啟動。它不執行任何終止腳本,而只是解除安裝文件系統並重新啟動系統。reboot 命令更有力。

來源:http ://www.vreference.com/2009/09/23/reboot-is-not-the-same-as-init-6/

對於 Solaris 等 Unix 系統,這似乎是正確的,但我一直將以下 3 個命令視為同義詞,因為它們似乎都在解除安裝文件系統並重新啟動伺服器之前關閉了服務:

shutdown -r now
reboot
init 6

有人能說出這些命令之間的區別嗎?

它們沒有區別。在內部他們做同樣的事情:

1. reboot uses the shutdown command (with the -r switch). The shutdown command used to 
   kill all the running processes, unmount all the file systems and finally tells the
   kernel to issue the ACPI power command.

2.init 6 tells the init process to shutdown all of the spawned processes/daemons as
  written in the init files (in the inverse order they started) and lastly invoke the 
  shutdown -r now command to reboot the machine

引用自:https://serverfault.com/questions/511614