From 1328bb5aba704a81d3cd8a227515a5d859bfc472 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Fri, 16 Jun 2023 01:10:49 +0330 Subject: [PATCH] gracefully shutdown xray-core Co-Authored-By: Alireza Ahmadi --- xray/process.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xray/process.go b/xray/process.go index 60c53320..42b2ee5c 100644 --- a/xray/process.go +++ b/xray/process.go @@ -12,6 +12,7 @@ import ( "runtime" "strings" "sync" + "syscall" "x-ui/config" "x-ui/util/common" @@ -227,5 +228,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) }