NAME
rset —
remote staging and execution
tool
SYNOPSIS
rset |
[-AnRt] [-E
environment] [-F
sshconfig_file] [-f
routes_file] [-x
label_pattern] hostname
... |
rset |
[-E environment]
[-F sshconfig_file]
[-f routes_file]
[-x label_pattern]
-o log_directory
-p workers
hostname ... |
rset |
command |
DESCRIPTION
rset evaluates script fragments written in
Progressive Label Notation
(pln(5)), executing each script in sequence using ssh connection
multiplexing.
rset expects one or more hostnames
matching labels in the routes_file. If arguments
contain characters consistent with a valid network address, they are
compared with all host aliases, otherwise they are treated as regular
expressions.
Arguments
-A- Download files listed in label export paths to the local _archive directory in the format ‘hostname:basename(filename)’. Absolute paths are permitted, or paths relative to the staging directory.
-Eenvironment- Set one or more environment variables using the format ‘name="value" ...’.
-Fsshconfig_file- Specify a config file for ssh(1) to use.
-froutes_file- Specify a routes_file. This file is composed of labels which correspond to hostnames or IP addresses which are matched against hostname. The default is routes.pln.
-olog_directory- Log directory to use for background workers. Each log file is created for
each worker using the format
‘
YYYY-MM-DD_HHMMSS.n’. -n- Do not connect to remote hosts. May be combined with
-xto highlight label names that match. Special text defined between { and } is still executed locally. -pworkers- Parallel execution distributed across the specified number of workers. The
log directory must also be specified using
-o. A summary of results is displayed using the rexec-summary script located in the search path. -R- Send files listed in label export paths from the local
_archive directory. This is the reverse of
-A. -t- Allow TTY input by copying the content of each label to the remote host instead of opening a pipe to the interpreter.
-xlabel_pattern- Execute labels matching the specified regex. By default only labels beginning with [0-9a-z] are evaluated.
Commands
shell-env- Print environment used by parallel execution. Provides a configuration template for custom status messages.
ENVIRONMENT
Status Format
Status messages for each stage of execution may be customized by
setting RSET_HOST_CONNECT,
RSET_HOST_CONNECT_ERROR,
RSET_LABEL_EXEC_BEGIN,
RSET_LABEL_EXEC_END,
RSET_LABEL_EXEC_ERROR, and
RSET_HOST_DISCONNECT.
Setting RSET_HOST_CONNECT disables the
default status messages and is the only required variable. These have no
effect in conjunction with the -n flag. The
following variables are interpolated:
%e- exit code
%l- label name
%h- hostname
%s- session identifier
%T- rfc-3339 timestamp
%%- literal ‘
%’
Diagnostics
HTTP_TRACE- If defined, print log messages from miniquark(1).
SSH_TRACE- If defined, print commands used for remote execution.
Remote Execution
The following environment variables are set on the remote host:
INSTALL_URL- Used by rinstall(1) for fetching content from _sources.
SD- Staging directory where
rsetunpacks utilities and configuration files.
State may set for the duration of the ssh session using
renv(1) using
‘name=value’ as the first
argument.
OPTIONS
The following options are recognized when parsing a pln(5) file:
environment=- Space separated list of environment variables validated by renv(1).
environment_file=- Space separated list of files defining environment variables validated by renv(1).
interpreter=- The interpreter used to run scripts on the remote host. Default is /bin/sh.
local_interpreter=- The interpreter to evaluate content that is prepended to a script Default is /bin/sh.
execute_with=- Command for elevating privileges, such as doas(1) and sudo(8).
SEE ALSO
AUTHORS
Eric Radman <ericshane@eradman.com>