Skip to main content

Module isolation

Module isolation 

Source
Expand description

Isolation Runners for start-command

Provides execution of commands in various isolated environments:

  • screen: GNU Screen terminal multiplexer
  • tmux: tmux terminal multiplexer
  • docker: Docker containers
  • ssh: Remote SSH execution

Re-exports§

pub use self::isolation_screen::get_screen_version;
pub use self::isolation_screen::supports_logfile_option;
pub use self::isolation_log::append_log_file;
pub use self::isolation_log::create_log_header;
pub use self::isolation_log::create_log_path;
pub use self::isolation_log::create_log_path_for_execution;
pub use self::isolation_log::generate_log_filename;
pub use self::isolation_log::get_default_docker_image;
pub use self::isolation_log::get_log_dir;
pub use self::isolation_log::get_temp_dir;
pub use self::isolation_log::get_temp_root;
pub use self::isolation_log::get_timestamp;
pub use self::isolation_log::write_log_file;
pub use self::isolation_log::LogHeaderParams;

Modules§

isolation_log
Logging and utility functions for isolation runners
isolation_screen
Screen-specific isolation helpers extracted from isolation.rs

Structs§

IsolationOptions
Options for isolation
IsolationResult
Result of an isolation run

Enums§

ShellQuotingStyle
Quoting dialect of the shell that will run a rebuilt command line.

Functions§

build_command_string
Rebuild a shell command line from the argv the user typed, for the host shell (issue #164).
build_command_string_with
Rebuild a shell command line from the argv the user typed, for a given shell dialect.
build_display_command
Build a display string that shows the argument boundaries the user typed (issues #91, #164).
build_shell_with_args_cmd_args
Build argv for a shell-with-c command; everything after -c is one script argument.
command_name
First word of a command line, used for failure reports and log headers.
detect_shell_in_environment
Detect the best available shell in an isolation environment (docker/ssh) Tries shells in order: bash, zsh, sh Returns the shell path to use
docker_image_exists
Check if a Docker image exists locally
docker_pull_image
Pull a Docker image with output streaming
get_shell
Get the shell to use for command execution
has_tty
Check if the current process has a TTY attached
is_command_available
Check if a command is available on the system
is_interactive_shell_command
True if command is a bare shell invocation (no -c); avoids bash-inside-bash (issue #84).
is_shell_invocation_with_args
True if command is a shell invocation with -c (e.g. bash -i -c "cmd"); avoids double-wrapping (issue #91).
quote_shell_arg
Quote one argv element for the host shell (issue #164).
quote_shell_arg_with
Quote one argv element so the target shell parses it back as exactly that element (issue #164).
run_as_isolated_user
Run command as an isolated user (without isolation backend)
run_in_docker
Run command in Docker container
run_in_screen
Run command in GNU Screen
run_in_ssh
Run command over SSH
run_in_tmux
Run command in tmux
run_isolated
Run command in the specified isolation backend
split_shell_words
Split a command line into shell words for the host shell dialect.
split_shell_words_with
Split a command line into shell words, reversing quote_shell_arg_with for the same dialect: a POSIX shell escapes with a backslash, PowerShell has no backslash escape (it is a path separator) and writes a literal quote as a doubled one.
to_shell_words
Split a command into words, falling back to whitespace splitting when quoting is unbalanced.
wrap_command_with_user
Wrap command with sudo -u if user option is specified