RUN(1)                     OpenBSD Reference Manual                     RUN(1)

NAME
     run - run a command on a machine at random

SYNOPSIS
     run [-aeiqtv] [-g rungroup1,...,rungroupN] [-l username] [-o porttimeout]
         [-p portnum] [-w node1,...,nodeN] [-x node1,...,nodeN] [command ...]

DESCRIPTION
     The run utility can be used to run a command, or group of commands on a
     cluster of machines.  The command or commands are run on a single node in
     the cluster, which is chosen at random.  The following options are
     available:

     -a   The -a option modifies the behavior of seq when dealing with stdin.
          Normally all commands from stdin are run on the same machine.
          Specifying the -a option causes each command to be run on a random
          node.

     -e   Unless the -e option is specified, stderr from remote commands will
          not be reported to the user.

     -i   The -i option will list information about the current cluster, and
          command groupings.  It will also show you which command you are
          about to run, and your username if specified with the -l option.

     -q   The -q option does not issue any commands, but displays information
          about the cluster.

     -v   Prints the version of ClusterIt to the stdout, and exits.

     -g   If the -g option is specified, followed by a comma separated list of
          group names, the command will only be run on that group of nodes.  A
          node may be a part of more than one group if desired, however
          running without the -g option will run the command on the same node
          as many times as it appears in the file specified by the CLUSTER
          environment variable.  This option is silently ignored if used with
          the -w option.

     -l   If the -l option is specified, followed by a username, the commands
          will be run under that userid on the remote machines.  Consideration
          must be taken for proper authentication, for this to work.

     -o   The -o option is used to set the timeout in seconds to be used when
          testing remote connections.  The default is five seconds.

     -p   The -p option can be used to set the port number that testing should
          occur on when testing remote connections.  The default behavior is
          to guess based on the remote command name.

     -t   The -t option causes run to attempt a connection test to each node
          prior to attempting to run the remote command.  If the test fails
          for any reason, the remote command will not be attempted.  This can
          be useful when clusterfiles have suffered bitrot and some nodes no
          longer exist, or might be down for maintenance.  The default timeout
          is 5 seconds.  The timeout can be changed with the -o option.  run
          will attempt to guess the port number of the remote service based on
          your RCMD_CMD setting.  It knows about ssh and rsh.  If run fails to
          guess your port correctly, you may use the -p argument to set the
          remote port number.  If the RCMD_TEST environment variable exists,
          the testing will automatically take place.

     -w   If the -w option is specified, followed by a comma delimited list of
          machine names, the command will be run on each node in the list.
          Without this option, run runs on the nodes listed in the file
          pointed to by the CLUSTER environment variable.

     -x   The -x option can be used to exclude specific nodes from the
          cluster.  The format is the same as the -w option, a comma delimited
          list of machine names.  This option is silently ignored if used with
          the -w option.

ENVIRONMENT
     run utilizes the following environment variables.

     CLUSTER        Contains a filename, which is a newline separated list of
                    nodes in the cluster.

     RCMD_CMD       Command to use to connect to remote machines.  The command
                    chosen must be able to connect with no password to the
                    remote host.  Defaults to ssh.

     RCMD_CMD_ARGS  Arguments to pass to the remote shell command.  Defaults
                    to none.

     RCMD_USER      The username to connect to remote machines as by default.

     RCMD_PORT      The port number used to test remote connections.  See the
                    -p flag.

     RCMD_TEST      When set, run will automatically test all hosts before
                    launching the remote command. See the -t option for more
                    information.

     RCMD_TEST_TIMEOUT
                    The timeout in seconds to use when testing for remote
                    connections.

DIAGNOSTICS
     Exit status is 0 on success, 1 if an error occurs.

SEE ALSO
     dsh(1), rsh(1), seq(1), kerberos(3), hosts.equiv(5), rhosts(5)

HISTORY
     The run command appeared in clusterit 1.1.

AUTHOR
     Run was written by Tim Rightnour.

                               January 10, 2007
