flux exec [--noinput] [--label-io] [—dir=DIR'] [--rank=NODESET] [--verbose] COMMANDS...
flux exec runs commands across one or more Flux broker ranks using the broker.exec service. The commands are executed as direct children of the broker, and the broker handles buffering stdout and stderr and sends the output back to flux exec which copies output to its own stdout and stderr.
On receipt of SIGINT and SIGTERM signals, flux exec shall forward the received signal to all currently running remote processes.
In the event subprocesses are hanging or ignoring SIGINT, two SIGINT signals (typically sent via Ctrl+C) in short succession can force flux exec to exit.
flux exec is meant as an administrative and test utility, and cannot be used to launch Flux jobs.
In the case that all processes are successfully launched, the exit status of flux exec is the largest of the remote process exit codes.
If a non-existent rank is targeted, flux exec will return with code 68 (EX_NOHOST from sysexits.h).
If one or more remote commands are terminated by a signal, then flux exec exits with exit code 128+signo.
- -l, --label-io
Label lines of output with the source RANK.
- -n, --noinput
Do not attempt to forward stdin. Send EOF to remote process stdin.
- -d, --dir=DIR
Set the working directory of remote COMMANDS to DIR. The default is to propagate the current working directory of flux-exec(1).
- -r, --rank=NODESET
Target specific ranks in NODESET. Default is to target "all" ranks. See NODESET FORMAT below for more information.
- -v, --verbose
Run with more verbosity.
- -q, --quiet
Suppress extraneous output (e.g. per-rank error exit status).
Prepend the full path to flux-imp run to COMMANDS. This option is mostly meant for testing or as a convenience to execute a configured
epilogcommand under the IMP. Note: When this option is used, or if flux-imp is detected as the first argument of COMMANDS, flux exec will use flux-imp kill to signal remote commands instead of the normal builtin subprocess signaling mechanism.
A NODESET is a comma separated list of integer ranks. Ranks may be listed individually or as a range in the form l-k where l < k.
Some examples of nodesets.
ranks 0, 1, 2, and 3 listed in a range
ranks 0, 1, 2, and 3 listed individually
ranks 2 and 5
ranks 2, 4, and 5
As a special case, the string ``all'' can be specified to indicate every rank available in the flux instance.