Browse Source

gracefully shutdown xray-core

Co-Authored-By: Alireza Ahmadi <[email protected]>
MHSanaei 1 năm trước cách đây
mục cha
commit
1328bb5aba
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      xray/process.go

+ 2 - 1
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)
 }