From 38a431a5520263b1614382c88a012be3118b86da Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Wed, 21 Sep 2022 15:32:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=91=BD=E4=BB=A4=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/cmd/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/cmd/main.go b/services/cmd/main.go index c27ea7723..90af112a2 100644 --- a/services/cmd/main.go +++ b/services/cmd/main.go @@ -186,6 +186,7 @@ func startService(sseting *core.ServiceSttings) (err error) { cmd *exec.Cmd command string confpath string = fmt.Sprintf("./conf/%s.yaml", sseting.Id) + output []byte ) switch sseting.Type { case comm.Service_Gateway: //网关服务 @@ -203,7 +204,10 @@ func startService(sseting *core.ServiceSttings) (err error) { } log.Debug("启动外部命令", log.Field{Key: "cmd", Value: command}) cmd = exec.Command("/bin/bash", "-c", command) - err = cmd.Run() + if output, err = cmd.CombinedOutput(); err != nil { + return + } + log.Debug(string(output)) return }