Browse Source

Client run bug

刘河 6 years ago
parent
commit
00a4a33c5f
2 changed files with 6 additions and 1 deletions
  1. 1 0
      client/control.go
  2. 5 1
      lib/daemon/daemon.go

+ 1 - 0
client/control.go

@@ -163,6 +163,7 @@ re:
 	}
 
 	c.Close()
+	logs.Notice("Temporary access login key ", vkey)
 	NewRPClient(cnf.CommonConfig.Server, vkey, cnf.CommonConfig.Tp, cnf.CommonConfig.ProxyUrl, cnf).Start()
 	CloseLocalServer()
 	goto re

+ 5 - 1
lib/daemon/daemon.go

@@ -24,21 +24,25 @@ func InitDaemon(f string, runPath string, pidPath string) {
 	switch os.Args[1] {
 	case "start":
 		start(args, f, pidPath, runPath)
+		os.Exit(0)
 	case "stop":
 		stop(f, args[0], pidPath)
+		os.Exit(0)
 	case "restart":
 		stop(f, args[0], pidPath)
 		start(args, f, pidPath, runPath)
+		os.Exit(0)
 	case "status":
 		if status(f, pidPath) {
 			log.Printf("%s is running", f)
 		} else {
 			log.Printf("%s is not running", f)
 		}
+		os.Exit(0)
 	case "reload":
 		reload(f, pidPath)
+		os.Exit(0)
 	}
-	os.Exit(0)
 }
 
 func reload(f string, pidPath string) {