原由在于:重启服务器后有时候服务不会启动,而有时候又能够自动运行,惟一差异在于重启命令用的是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
|