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§
- Exec
Controller - A cloneable handle for driving a running command (stdin, signals, window size) from other threads while one thread reads its output.
- Exec
Options - Per-call exec options. Unset fields fall back to the sandbox’s exec defaults.
- Exec
Output - Captured result of
crate::Sandbox::exec. - Exec
Stream - A running command. Iterate it for output;
ExecStream::waitfor the exit code. - Guest
User - A guest user resolved to ids.
Enums§
- Exec
Event - 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 passwdline. - 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.