Skip to main content

Module exec

Module exec 

Source
Expand description

Running commands in a sandbox over the incus exec websocket API.

  • argv is passed as a list, never joined into sh -c.
  • Output is streamed as produced, and there is no default timeout.
  • stdin, when the caller asks for it, is forwarded and closed properly. A caller whose own stdin is an inherited pipe that never reaches EOF does not hang: the forwarder polls and stops when the command exits.
  • Closing the control websocket kills the command in incus, so it is held open until the operation finishes.

Structs§

ExecController
A cloneable handle for driving a running command (stdin, signals, window size) from other threads while one thread reads its output.
ExecOptions
Per-call exec options. Unset fields fall back to the sandbox’s exec defaults.
ExecOutput
Captured result of crate::Sandbox::exec.
ExecStream
A running command. Iterate it for output; ExecStream::wait for the exit code.
GuestUser
A guest user resolved to ids.

Enums§

ExecEvent
A chunk of output, in the order it was produced per stream.
Stdin
Where the command’s stdin comes from.

Functions§

parse_passwd
Parse a getent passwd line.
stdio_is_tty
Whether both stdin and stdout are terminals (the default for -t).
terminal_size
Width and height of the terminal on stdout, if it is one.