Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMHSanaei <ho3ein.sanaei@gmail.com>2023-06-16 00:40:49 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2023-06-16 00:40:49 +0300
commit1328bb5aba704a81d3cd8a227515a5d859bfc472 (patch)
treee5b495eded517d65251df75533617c9561c6557a
parent4cc755c8830adc7c9cdd5ea769f893753a7d0a20 (diff)
gracefully shutdown xray-core
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
-rw-r--r--xray/process.go3
1 files changed, 2 insertions, 1 deletions
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)
}