|
一般情况下,从主导航栏下的 "System" --> "Reboot" ,单击 “Perform reboot” 时,系统会自动重启。查看 LUCI 代码,执行的是 luci.sys.reboot() 函数,但有时会失效,具体原因我暂时也没发现,不过解决办法是将 luci.sys.reboot() 替换成 luci.sys.call("reboot -f") 即可。
在 /usr/lib/lua/luci/controller/admin/system.lua 下找到 action_reboot() 函数,进行修改之:
- function action_reboot()
- local reboot = luci.http.formvalue("reboot")
- luci.template.render("admin_system/reboot", {reboot=reboot})
- if reboot then
- --luci.sys.reboot()
- luci.sys.call("reboot -f")
- end
- end
复制代码
|
|