From 9eac8afa3d1cfe25435eadf42b68d190f30a92df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Tue, 26 Apr 2022 12:22:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=81=9C=E6=AD=A2=E8=8A=82=E7=82=B9=E6=97=B6sy?= =?UTF-8?q?stemctl=E5=91=BD=E4=BB=A4=E4=B8=8D=E9=98=BB=E5=A1=9E=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E8=BF=9B=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/apps/app_cmd.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/apps/app_cmd.go b/internal/apps/app_cmd.go index 533b255..c1abe5b 100644 --- a/internal/apps/app_cmd.go +++ b/internal/apps/app_cmd.go @@ -217,7 +217,10 @@ func (this *AppCmd) runStop() { if runtime.GOOS == "linux" { systemctl, _ := exec.LookPath("systemctl") if len(systemctl) > 0 { - _ = exec.Command(systemctl, "stop", teaconst.SystemdServiceName).Run() + go func() { + // 有可能会长时间执行,这里不阻塞进程 + _ = exec.Command(systemctl, "stop", teaconst.SystemdServiceName).Run() + }() } }