Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Code

527 commit(s) on main

Put job execution behind an interface Keenan Nemetz · 2h ago de3eec16
history blame raw 601 B
1//go:build unix
2
3package agent
4
5import (
6 "os/exec"
7 "syscall"
8)
9
10// newProcessGroup puts the command in its own process group, so a timeout or a
11// stop request can signal the whole tree instead of only the process it started.
12func newProcessGroup(cmd *exec.Cmd) {
13 cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
14}
15
16// killProcessGroup kills the group the command leads. A negative pid names the
17// group, so a build step's own children go with it.
18func killProcessGroup(cmd *exec.Cmd) error {
19 if cmd.Process == nil {
20 return nil
21 }
22 return syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL)
23}
24