标题: 问一个很简单的问题 [打印本页] 作者: leaonlew 时间: 2005-01-24 16:50 标题: 问一个很简单的问题 reboot 和shutdow -ry 0有什么区别?作者: camham 时间: 2005-01-24 18:06 标题: 问一个很简单的问题 应该是使用shutdown好一些,可以正常关闭系统进程(init守护的).
不确定作者: leaonlew 时间: 2005-01-24 18:48 标题: 问一个很简单的问题 据了解shutdown是正常关闭行程,而reboot只是kill进程,shutdown -ry 0的安全性高作者: eee_fish 时间: 2005-01-25 11:56 标题: 问一个很简单的问题 shutdown -ry 0
虽然也是立刻从新启动,但是这条命令仍然会正常的关闭进程,正常卸栽文件系统,正常执行用户自定义的关机脚本(例如关闭数据库等)。
reboot
立刻使用kill -9杀死所有运行进程,把文件系统标为干净的,然后立刻启动。所以有可能造成文件系统出现问题,数据库系统的不正常关闭,用户数据的丢失等。所以建议不要在多用户下使用该命令。作者: 朽木可雕 时间: 2005-01-25 12:25 标题: 问一个很简单的问题 The shutdown Command Details
Executing the shutdown command stops system activities in an orderly and consistent
manner. The shutdown command performs the following tasks:
• Prompts the administrator for a broadcast message to send to all users.
• Broadcasts the warning message to all user terminal sessions.
• Grants a 60 second (by default) grace period for users to log out.
• Kills all user logins.
• Shuts down all non-critical processes.
• Unmounts all non-critical file systems.
Depending on the option specified, shutdown will either leave the system in single-user mode
(no options), the halt state (if -h was specified), or initiate a reboot (if -r was specified).
Common shutdown options:
# shutdown -hy 600 # shutdown to a halt state in 600 seconds.
# "-y" (yes) option prevents shutdown from
# requesting confirmation before proceeding.
# shutdown -ry 600 # reboot in 600 seconds without requesting confirmation.
# shutdown -ry 0 # reboot immediately without requesting confirmation.
Reboot Command Details
The reboot command uses "kill -9" to kill running processes,
quickly, but can cause problems for applications and file
shuts down applications and processes more gracefully,
halting or rebooting the system from multi-user mode.
The system is already in single-user mode.
You need to bring the system down very quickly.作者: leaonlew 时间: 2005-01-25 12:30 标题: 问一个很简单的问题 good作者: cqwlyh 时间: 2005-01-25 20:13 标题: 问一个很简单的问题 任何情况下,都建议管理员使用shutdown来关机或重新启动,原因有两方面:
1. shutdown会调用init来“安全”的关闭所有的进程,而reboot只是强行kill它找到的任何进程。
2. 如果修改了kernel,用reboot重新启动,系统是不会rebuilding内核的。