From 33321e89a19f86017118ee62a1f10d0a0ec15ee3 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Tue, 28 Jun 2016 18:31:12 +0800 Subject: [PATCH] don't launch console service when in daemon mode --- examples/config | 4 +++- examples/main.lua | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/config b/examples/config index 9533af814..368a06f6d 100644 --- a/examples/config +++ b/examples/config @@ -9,7 +9,9 @@ start = "main" -- main script bootstrap = "snlua bootstrap" -- The service for bootstrap standalone = "0.0.0.0:2013" luaservice = root.."service/?.lua;"..root.."test/?.lua;"..root.."examples/?.lua" -lualoader = "lualib/loader.lua" +lualoader = root .. "lualib/loader.lua" +lua_path = root.."lualib/?.lua;"..root.."lualib/?/init.lua" +lua_cpath = root .. "luaclib/?.so" -- preload = "./examples/preload.lua" -- run preload.lua before every lua service run snax = root.."examples/?.lua;"..root.."test/?.lua" -- snax_interface_g = "snax_g" diff --git a/examples/main.lua b/examples/main.lua index cac497371..5a2150dbf 100644 --- a/examples/main.lua +++ b/examples/main.lua @@ -6,7 +6,9 @@ local max_client = 64 skynet.start(function() skynet.error("Server start") skynet.uniqueservice("protoloader") - local console = skynet.newservice("console") + if not skynet.getenv "daemon" then + local console = skynet.newservice("console") + end skynet.newservice("debug_console",8000) skynet.newservice("simpledb") local watchdog = skynet.newservice("watchdog")