Skip to end of metadata
Go to start of metadata

Contents

Introduction

An intermediate server which simplifies access to remote targets. Although it can be used otherwise, it is used by rurun, and rumpirun.

Configuration

SectionOptionValueDescription
targetsfilenamepathPath to file containing list of targets.

Targets File

The targets file contains a list of targets, one per line:

[<user>@]<host>[:<port>] [<cgroup>]
...

The <cgroup> may use ":" in place of "/" where it contains slashes.

Usage

Provides access to local/remote targets (e.g., user@host) using a
relay (e.g., ssh service).

/count
    Output the number of targets registered.

/first/... <args>

/host/<user@host>/... <args>
    Connect to service ... at target (i.e., user@host) verified
    by a lookup into the targetsfile list. Only available if a
    targetsfile was given at startup.

/id/<index>/... <args>
    Connect to service ... at target (host only) identified by a
    lookup into the targetsfile list at <index>. A negative index
    starts at the last entry (-1 is the last entry). An index
    starting with : loops around to continue the lookup.

/net/<user@host>/... <args>
    Connect to service ... at unregistered target (i.e.,
    user@host).

/next/... <args>
    Connect to the 'next' target selected from the targetsfile
    list. Each call bumps to 'next' and wraps to 0 as needed.

/random/... <args>
    Connect to a randomly selected target from the targetsfile
    list.

/run/<index>/<method> <args>
    Run exec-based service, where method corresponds to what is
    provided by the exec server (e.g., simple, shell, login), at
    target identified by a lookup into the targetsfile list at
    <index>. A negative index starts at the last entry (1 is the
    last entry). An index starting with : loops around to continue
    the lookup. If a cgroup is defined in targetsfile, it is used
    in the call.

Examples

A basic targets file contains only hosts (one per line):

hostA
hostB
hostC
hostD

Each target corresponds to an index, starting at 0 (i.e., hostA in the list above).

The targets file also allows for specifying cgroups:

hostA jobs:123-0
hostB jobs:123-1
hostC jobs:123-2
hostD jobs:123-3

The ":" in the cgroup name is understood by the exec server to mean "/" when determining a final cgroup path.

Once set up, the pnet id service can be used to connect to a target. E.g., assuming an existing pnet server running at pnet:

ruexec pnet/id/0/+/debug/exit 1

The target associated with index 0 (the first line in the targets list) will be called to run the debug/exit service. This is functionally equivalent to:

ruexec +/ssh/host0/+/debug/exit 1

The run service called in a slightly different way, i.e., specifying the exec method (simple, shell, or login):

ruexec pnet/run/0/shell hostname

and is functionally equivalent to:

ruexec +/ssh/host0/+/exec/cgroup/jobs:123-0/shell hostname

Notice how the spath generated by the run service provides:

  • +/ssh - the relay
  • +/exec - in preparation to execute a program
  • cgroup/jobs:123-0 - to select a cgroup in which to execute a program