Skip to content

Commit

Permalink
gracefully shutdown xray-core
Browse files Browse the repository at this point in the history
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
  • Loading branch information
MHSanaei and alireza0 committed Jun 15, 2023
1 parent 4cc755c commit 1328bb5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xray/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"runtime"
"strings"
"sync"
"syscall"
"x-ui/config"
"x-ui/util/common"

Expand Down Expand Up @@ -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)
}

0 comments on commit 1328bb5

Please sign in to comment.