diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-06-16 00:40:49 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-06-16 00:40:49 +0300 |
| commit | 1328bb5aba704a81d3cd8a227515a5d859bfc472 (patch) | |
| tree | e5b495eded517d65251df75533617c9561c6557a /xray | |
| parent | 4cc755c8830adc7c9cdd5ea769f893753a7d0a20 (diff) | |
gracefully shutdown xray-core
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
Diffstat (limited to 'xray')
| -rw-r--r-- | xray/process.go | 3 |
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) } |
