Add luci.lucid.running()

This commit is contained in:
Steven Barth 2009-07-27 12:28:34 +00:00
parent 17e7f67a7c
commit 45cf10a665

View file

@ -60,6 +60,12 @@ function start()
run() run()
end end
--- Returns the PID of the currently active LuCId process.
function running()
local pid = tonumber(state:get(UCINAME, "main", "pid"))
return pid and nixio.kill(pid, 0) and pid
end
--- Stops any running LuCId superprocess. --- Stops any running LuCId superprocess.
function stop() function stop()
local pid = tonumber(state:get(UCINAME, "main", "pid")) local pid = tonumber(state:get(UCINAME, "main", "pid"))