Documentation
¶
Overview ¶
Package proctree runs a command as the root of its own process tree and kills the whole tree: hooks and the shell tools share it, so a timeout takes down whatever the command started as well.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Kill ¶
Kill sends SIGKILL to cmd's process group. A command that never started, or whose group is already gone, is not an error.
Called after Wait, the group leader has been reaped; the kernel cannot recycle a pgid while any member of the group still exists, so the only residual risk is an unrelated new group leader that reused this exact pid after the group emptied.
func Release ¶
Release lets go of what Start kept for Kill. A process group needs nothing, so on unix it does nothing; call it anyway, after Wait and any Kill, for Windows.
func Start ¶
Start starts cmd in a new process group and makes cancelling its context kill the whole group. Use it instead of cmd.Start; it keeps any other SysProcAttr fields already set. cmd must come from exec.CommandContext.
func StartSession ¶
StartSession is Start in a new session instead of only a new process group: the command has no controlling terminal, so it cannot open /dev/tty and type into celeste's prompts (TIOCSTI). The session leader leads a process group of the same id, so Kill and cancelling the context still end the whole group. The sandboxed shell runs use it.
Types ¶
This section is empty.