diff options
Diffstat (limited to 'libs/lucid/luasrc/lucid.lua')
-rw-r--r-- | libs/lucid/luasrc/lucid.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/lucid/luasrc/lucid.lua b/libs/lucid/luasrc/lucid.lua index 62741e79f5..d72bf25ef9 100644 --- a/libs/lucid/luasrc/lucid.lua +++ b/libs/lucid/luasrc/lucid.lua @@ -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"))) |