Skip to content

Commit 550b7b0

Browse files
committed
start: separate pgid for watchdog process
Set separate process group for watchdog process, so it will not be killed by a closed ssh session.
1 parent bc08e6a commit 550b7b0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cli/cmd/start.go

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"os"
66
"os/exec"
7+
"syscall"
78

89
"github.com/apex/log"
910
"github.com/spf13/cobra"
@@ -65,6 +66,8 @@ func startWatchdog(ttExecutable string, instance running.InstanceCtx) error {
6566
newArgs := []string{"start", "--watchdog", appName}
6667

6768
wdCmd := exec.Command(ttExecutable, newArgs...)
69+
// Set new pgid for watchdog process, so it will not be killed after a session is closed.
70+
wdCmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
6871
return wdCmd.Start()
6972
}
7073

0 commit comments

Comments
 (0)