Skip to content

command: Add option to spawn a command with a pgid

John Cai requested to merge jc-spawn-git-in-pgid into master

Processes can be spawned with pgid [1], which can then be used to kill a process and all child processes that were spawned with that pid as a pgid.

This allows us to, in a later commit, tie all Git commands to the main Gitaly process. When a Gitaly process exits, a sys admin, a script, or Gitlab Omnibus can do a kill -9 -<old gitaly pid> to kill any process that has as its pgid.

Add an option to allow commands to be instantiated with a parent pid.

  1. https://pkg.go.dev/syscall#SysProcAttr

fixes: #4493 (closed)

Merge request reports