From 2f6c8c23e35f07918033d5e0a5b4021d79b9afe5 Mon Sep 17 00:00:00 2001 From: Timothy Date: Wed, 29 Jun 2016 18:21:58 +0800 Subject: [PATCH] Add parameter to support dockernize --- godns.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/godns.go b/godns.go index 9fe7ed3..91b42ab 100644 --- a/godns.go +++ b/godns.go @@ -18,8 +18,9 @@ const ( var ( configuration Settings - optConf = flag.String("c", "./config.json", "config file") - optHelp = flag.Bool("h", false, "this help") + optConf = flag.String("c", "./config.json", "Specify a config file") + optDocker = flag.Bool("d", false, "Run it as docker mode") + optHelp = flag.Bool("h", false, "Show help") panicCount = 0 ) @@ -87,6 +88,7 @@ func dnsLoop() { panicCount++ log.Printf("Recovered in %v: %v\n", err, debug.Stack()) fmt.Println(identifyPanic()) + log.Print(identifyPanic()) if panicCount < PANIC_MAX { log.Println("Got panic in goroutine, will start a new one... :", panicCount) go dnsLoop()