启动时增加sid设置

This commit is contained in:
GoEdgeLab
2021-12-06 19:28:00 +08:00
parent 1d7c51bb26
commit f1484d0395

View File

@@ -11,6 +11,7 @@ import (
"os/exec"
"runtime"
"strconv"
"syscall"
"time"
)
@@ -187,6 +188,11 @@ func (this *AppCmd) runStart() {
_ = os.Setenv("EdgeBackground", "on")
cmd := exec.Command(os.Args[0])
cmd.SysProcAttr = &syscall.SysProcAttr{
Foreground: false,
Setsid: true,
}
err := cmd.Start()
if err != nil {
fmt.Println(this.product+" start failed:", err.Error())