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

View File

@@ -65,8 +65,11 @@ skynet.start(function()
skynet.ret(skynet.pack(nil))
end
end)
skynet.register(".service")
if skynet.getenv "standalone" then
skynet.register("SERVICE")
local handle = skynet.localname ".service"
if handle ~= 0 then
skynet.error(".service is already register by ", skynet.address(handle))
skynet.exit()
else
skynet.register(".service")
end
end)