From e1e5899a90d83d7a76cd81fc280b1e15324d9c92 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Wed, 14 Jun 2023 22:29:39 +0200 Subject: [PATCH] gracefully shutdown xray-core --- xray/process.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xray/process.go b/xray/process.go index afc083c6..ae8e7019 100644 --- a/xray/process.go +++ b/xray/process.go @@ -11,6 +11,7 @@ import ( "os/exec" "runtime" "strings" + "syscall" "x-ui/config" "x-ui/util/common" @@ -220,5 +221,5 @@ func (p *process) Stop() error { if !p.IsRunning() { return errors.New("xray is not running") } - return p.cmd.Process.Kill() + return p.cmd.Process.Signal(syscall.SIGTERM) }