Documentation
¶
Overview ¶
Package sudocancel is how factory-agent cancels a command it runs with a context: a sudo call gets SIGTERM, which sudo relays to its command, and SIGKILL only after a grace; anything else gets SIGKILL at once. host init, the kata workspace driver and the in-VM runtime share it.
sudo can't relay a SIGKILL, so its command, root and out of factory-agent's reach, would run on to its own bounds: the kata helper's nerdctl, a root script's install. On SIGTERM, sudo also restores the terminal's echo when it's interrupted at its password prompt.
sudo stays in factory-agent's process group, so a terminal's Ctrl-C or hangup reaches it as well, and it relays those too. It ignores a signal sent from a process group that sudo or its command leads (sudo 1.9.15's exec_nopty.c and exec_pty.c), never factory-agent's.
Index ¶
Constants ¶
const HelperGrace = 30 * time.Second
HelperGrace is the kata helper's: it stops its nerdctl and removes what it made (an image-build's context copy) in well under it.
const OutputDelay = 10 * time.Second
OutputDelay is how long Wait waits, after a command that isn't sudo is killed, for a child that holds its output open.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package sudocanceltest checks that a runner cancels commands the sudocancel way, with a stand-in for sudo: real sudo never runs.
|
Package sudocanceltest checks that a runner cancels commands the sudocancel way, with a stand-in for sudo: real sudo never runs. |