免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1374 | 回复: 6
打印 上一主题 下一主题

问一个很简单的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-01-24 16:50 |只看该作者 |倒序浏览
reboot 和shutdow -ry 0有什么区别?

论坛徽章:
0
2 [报告]
发表于 2005-01-24 18:06 |只看该作者

问一个很简单的问题

应该是使用shutdown好一些,可以正常关闭系统进程(init守护的).
不确定

论坛徽章:
0
3 [报告]
发表于 2005-01-24 18:48 |只看该作者

问一个很简单的问题

据了解shutdown是正常关闭行程,而reboot只是kill进程,shutdown -ry 0的安全性高

论坛徽章:
0
4 [报告]
发表于 2005-01-25 11:56 |只看该作者

问一个很简单的问题

shutdown -ry 0
虽然也是立刻从新启动,但是这条命令仍然会正常的关闭进程,正常卸栽文件系统,正常执行用户自定义的关机脚本(例如关闭数据库等)。
reboot
立刻使用kill -9杀死所有运行进程,把文件系统标为干净的,然后立刻启动。所以有可能造成文件系统出现问题,数据库系统的不正常关闭,用户数据的丢失等。所以建议不要在多用户下使用该命令。

论坛徽章:
0
5 [报告]
发表于 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.

论坛徽章:
0
6 [报告]
发表于 2005-01-25 12:30 |只看该作者

问一个很简单的问题

good

论坛徽章:
0
7 [报告]
发表于 2005-01-25 20:13 |只看该作者

问一个很简单的问题

任何情况下,都建议管理员使用shutdown来关机或重新启动,原因有两方面:
1. shutdown会调用init来“安全”的关闭所有的进程,而reboot只是强行kill它找到的任何进程。
2. 如果修改了kernel,用reboot重新启动,系统是不会rebuilding内核的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP