openwrt15.05 failsafeモジュールを追加し、WEBログインエラー
1815 ワード
最近新しいルータにopenwrt 15を移植する.05,failsafeモジュールを追加したことを発見した後、webログインは以下のエラーを提示した.
/usr/lib/lua/luci/controller/failsafe/failsafeを開きます.luaファイル、検出
ここでの
/usr/lib/lua/luci/dispatcher.lua:433: Failed to execute function dispatcher target for entry '/'.
The called action terminated with an exception:
/usr/lib/lua/luci/dispatcher.lua:433: Failed to execute function dispatcher target for entry '/failsafe'.
The called action terminated with an exception:
/usr/lib/lua/luci/dispatcher.lua:433: Failed to execute call dispatcher target for entry '/failsafe/flashops'.
The called action terminated with an exception:
/usr/lib/lua/luci/controller/failsafe/failsafe.lua:91: attempt to index upvalue 'fp' (a nil value)
stack traceback:
[C]: in function 'assert'
/usr/lib/lua/luci/dispatcher.lua:433: in function 'dispatch'
/usr/lib/lua/luci/dispatcher.lua:168: in function
/usr/lib/lua/luci/controller/failsafe/failsafeを開きます.luaファイル、検出
local fp
luci.http.setfilehandler(
function(meta, chunk, eof)
if not fp then
if meta and meta.name == "image" then
fp = io.open(image_tmp, "w")
end
end
if chunk then
fp:write(chunk)
end
if eof then
***fp:close()***
end
end
)
ここでの
fp:cloase()
はエラーを報告し、ここでの判断条件をif eof and fp then
に変更してテストOKとし、徹底的に修正するためにopenwrt-15.05/openwrt/package/feeds/luci/luci-mod-failsafe/luasrc/controller/failsafe
を開き、この文書のif eof then判断条件をif eof and fp thenに変更すればよい.