请教一个关机命令shutdown

本帖最后由 vernice 于 2011-1-5 11:41 编辑

执行shutdown命令时,自动执行sync吗?

作者: vernice   发布时间: 2011-01-05

我记得要手动执行sync是很久前的事了,,
shutdown应该会自动做的,

作者: 奶茶dsk   发布时间: 2011-01-05

奶茶dsk


我看资料时,感觉他说的模模糊糊的。reboot -n是不执行sync的。不知道shutdown和reboot是不是都自动执行了~

作者: vernice   发布时间: 2011-01-05

man reboot
       -n    Does not call sync(2) before performing the reboot; this could result in data loss. On Linux, this  proba‐
              bly has no effect as the kernel flushes all write buffers before shutting down.
你看的资料有些年头了,随便翻翻吧,
有不确定就去查查man,

作者: 奶茶dsk   发布时间: 2011-01-05

奶茶dsk


嗯,多谢指点。这本书是09年的,Fedora9的~

作者: vernice   发布时间: 2011-01-05

shutdown 命令应该根据带的参数不同而执行的方式也不同吧

作者: jid_223   发布时间: 2011-01-05