浏览代码

capture sigterm

v2ray 9 年之前
父节点
当前提交
5dc80a2cc5
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      shell/point/main/main.go

+ 2 - 1
shell/point/main/main.go

@@ -6,6 +6,7 @@ import (
 	"os"
 	"os"
 	"os/signal"
 	"os/signal"
 	"path/filepath"
 	"path/filepath"
+	"syscall"
 
 
 	"github.com/v2ray/v2ray-core"
 	"github.com/v2ray/v2ray-core"
 	_ "github.com/v2ray/v2ray-core/app/router/rules"
 	_ "github.com/v2ray/v2ray-core/app/router/rules"
@@ -107,7 +108,7 @@ func main() {
 
 
 	if point := startV2Ray(); point != nil {
 	if point := startV2Ray(); point != nil {
 		osSignals := make(chan os.Signal, 1)
 		osSignals := make(chan os.Signal, 1)
-		signal.Notify(osSignals, os.Interrupt, os.Kill)
+		signal.Notify(osSignals, os.Interrupt, os.Kill, syscall.SIGTERM)
 
 
 		<-osSignals
 		<-osSignals
 		point.Close()
 		point.Close()