RSET(1) General Commands Manual RSET(1)

rsetremote staging and execution tool

rset [-AenRtv] [-E environment] [-F sshconfig_file] [-f routes_file] [-x label_pattern] hostname ...

rset [-ev] [-E environment] [-F sshconfig_file] [-f routes_file] [-x label_pattern] -o log_directory -p workers hostname ...

rset evaluates script fragments written in Progressive Label Notation (pln(5)), executing each script in sequence using ssh connection multiplexing. rset accepts one or more hostnames which match the labels in routes_file.

The arguments are as follows:

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.
Exit immediately if any label returns non-zero exit status.
Do not connect to remote hosts. May be combined with -x to highlight label names that match. Special text defined between { and } is still executed locally.
Send files listed in label export paths from the local _archive directory. This is the reverse of -A.
Allow TTY input by copying the content of each label to the remote host instead of opening a pipe to the interpreter.
Print the HTTP log messages after each label is executed.
Set one or more environment variables using the format ‘name="value" ...’.
Specify a config file for ssh(1) to use.
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.
Log directory to use for background workers. Each log file is created for each worker using the format ‘YYYY-MM-DD_HHMMSS.n’.
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.
Execute labels matching the specified regex. By default only labels beginning with [0-9a-z] are evaluated.

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 ‘%

Execution on the remote host sets the following environment variables:

Used by rinstall(1) for fetching content from _sources.
Staging directory where rset unpacks utilities and configuration files.

Environment state may set for the duration of the ssh session using renv(1) using ‘name=value’ as the first argument.

Available hosts and the pathnames to labeled scripts to run are read from routes.pln, located in the current directory.

A ssh master is established at the beginning of a session and all subsequent interactions with a host are run over a socket at /tmp/rset_control_{hostname}.

The local directory _rutils is created if it does not exist, and is shipped to the remote host at the beginning of each execution to directory named /tmp/rset_staging_{http_port}.

The following options are recognized when parsing a pln(5) file:

Space separated list of environment variables. Only values matching the pattern ‘name="value"’ are added to the environment on the remote host.

Path to a file which defines environment variables validated by renv(1).

The interpreter to run a script fragment with. Defaults to /bin/sh, but any language may be used that is capable of reading scripts over STDIN.

The interpreter to evaluate content that is prepended to a script Defaults to /bin/sh.

Command for elevating privileges, such as doas(1) and sudo(8).

The following are effective only for the subsequent label:

Execute a script using the ‘local_interpreter’ before the label is executed on the remote lost.

Execute a script using the ‘local_interpreter’ after the label is executed on the remote host.

miniquark(1), rinstall(1), rsub(1), ssh_config(5), re_format(7)

September 24, 2024 OpenBSD 7.6