Fix redirector
[project/luci.git] / libs / lucid / luasrc / lucid.lua
index 62741e79f5a3217a4e5f2ac1e9cb2dff8c5bd801..d72bf25ef9c6007f94c8067fe6adee506a2e6045 100644 (file)
@@ -54,9 +54,20 @@ function start()
                end
        end
 
+       state:set(UCINAME, "main", "pid", nixio.getpid())
+       state:save(UCINAME)
+
        run()
 end
 
+function stop()
+       local pid = tonumber(state:get(UCINAME, "main", "pid"))
+       if pid then
+               return nixio.kill(pid, nixio.const.SIGTERM)
+       end
+       return false
+end
+
 function prepare()
        local debug = tonumber((cursor:get(UCINAME, "main", "debug")))