linux重启命令init 6和reboot的区别

Init 6是重新启动机器。


init 6 Stop the operating system and reboot to the state defined by the initdefault entry in /etc/inittab.
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″基于一系列/etc/inittab文件,并且每个应用都会有一个相应shutdown脚本。
“init 6″调用一系列shutdown脚本(/etc/rc0.d/K*)来使系统优雅关机;
所以我们应该在通常情况下使用 init 6。

reboot is a more aggresive command to use. init 6 is much graceful
use of `init 6` will give the cleanest and orderly reboot (init informs svc.startd of the runlevel change and will move to the appropriate milestone).
use of `shutdown -y -g0 -i6 **message**` will invoke init as well as give you grace period and messages to user (shutdown invoked the same as init above).
halt,reboot,poweroff will not run any of the shutdown scripts and should be last resort.

  1. 我在机房的时候一般都是init 6

    1. 恩,看来我以后也要用这个命令了

Leave a Reply

Time limit is exhausted. Please reload the CAPTCHA.