add bootstrap script

This commit is contained in:
Cloud Wu
2014-04-29 13:43:40 +08:00
parent be948c6675
commit f6e67b7493
9 changed files with 43 additions and 20 deletions

13
service/bootstrap.lua Normal file
View File

@@ -0,0 +1,13 @@
local skynet = require "skynet"
skynet.start(function()
local launcher = assert(skynet.launch("snlua launcher"))
skynet.name(".launcher", launcher)
if skynet.getenv "standalone" then
local smgr = assert(skynet.newservice "service_mgr")
skynet.name("SERVICE", smgr)
end
assert(skynet.newservice(skynet.getenv "start" or "main"))
skynet.exit()
end)