Reboot与init 6的区别
2014-04-08 17:23
357 查看
起因在于:重启服务器后有时候服务不会启动,而有时候又可以自动运行,唯一差别在于重启命令用的是reboot还是init 6.
后查了相关资料,竟然大有玄机:
对这两个操作使用man命令看到的内容如下:
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*)来使系统优雅关机;
'reboot'并不执行这些过程,reboot更是一个 kernel级别的命令,不对应用使用shutdown脚本。 .
我们应该在通常情况下使用 init 6.
在出问题的状况下或强制重启 时使用reboot.
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.
后查了相关资料,竟然大有玄机:
对这两个操作使用man命令看到的内容如下:
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*)来使系统优雅关机;
'reboot'并不执行这些过程,reboot更是一个 kernel级别的命令,不对应用使用shutdown脚本。 .
我们应该在通常情况下使用 init 6.
在出问题的状况下或强制重启 时使用reboot.
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.
相关文章推荐
- Linux服务器重启中init6与reboot的区别
- linux常用关机命令及其区别-Shutdown halt reboot init
- reboot与shutdown -r now 区别与联系(又收集了init和halt的小知识)
- Reboot与init 6的区别
- 记录一下“halt ,reboot ,init,shutdown的区别”
- reboot和init 6之间的区别
- init, reboot区别
- reboot与shutdown -r now 区别与联系(又收集了init和halt的小知识)
- linux 下 reboot和init 6的区别
- reboot和init 6之间的区别
- init 6与 reboot的区别
- 重启命令:reboot与init 6的区别
- Linux下关机命令的区别 (halt,poweroff,reboot,shutdown,init)
- Reboot与init 6的区别
- reboot和init 6的区别
- init 6和reboot重启的区别
- init 6和reboot的区别
- linux服务器重启init 6和reboot区别
- Linux重启命令init 6和reboot的区别
- reboot和init 6之间的区别