pbs_attach(8B)

NAME
pbs_attach - attach a session ID to a PBS job

SYNOPSIS
Linux
pbs_attach [-j <job ID>] [-m <port>] -p <PID>
pbs_attach [-j <job ID>] [-m <port>] [-P] [-s] <cmd> [<arg> ...]
pbs_attach --version Windows
pbs_attach [-c <path to script>] [-j <job ID>] [-m <port>] -p <PID>
pbs_attach [-c <path to script>] [-j <job ID>] [-m <port>] [-P] [-s]
    <cmd> [<arg> ...]
pbs_attach --version

DESCRIPTION
The pbs_attach command associates the processes in a session with a PBS job by attaching the session ID to the job. This allows PBS MoM to monitor and control those processes. MoM uses process IDs to determine session IDs, which are put into MoM's task list (attached to the job.) All process IDs in a session are then associated with the job. When a command cmd is given as an operand, the pbs_attach process becomes the parent process of cmd, and the session ID of pbs_attach is attached to the job.

OPTIONS

-c <path to script>
    Windows only. Specified command is invoked using a new command shell. In order to spawn and attach built-in DOS commands such as set or echo, it is necessary to open the task using a cmd shell. The new command shell, cmd.exe , is attached as a task to the PBS job. The pbs_attach command spawns a program using a new command shell when attaching a batch script, or when invoked with the -c option.

-j <job ID>
    The job ID to which the session ID is to be attached. If job ID is not specified, a best effort is made to determine the job to which to attach the session.

-m <port>
    The port at which to contact MOM. Default: value of PBS_MANAGER_SERVICE_PORT from pbs.conf

-p <PID>
    Process ID whose session ID is to be attached to the job. Default: process ID of pbs_attach. Cannot be used with the -P or -s options or the cmd operand.

-P  Attach sessions of both pbs_attach and the parent of pbs_attach to job. When used with -s option, the sessions of the new fork() ed pbs_attach and its parent, which is pbs_attach, are attached to the job. Cannot be used with the -p or -s options or the cmd operand.

-s  Starts a new session and attaches it to the job: pbs_attach calls fork(), then the child pbs_attach first calls setsid() and then calls tm_attach to attach the new session to the job. The session ID of the new pbs_attach is attached to the job.

--version
    The pbs_attach command returns its PBS version information and exits. This option can only be used alone.

OPERANDS

cmd Name of command whose process ID is to be associated with the job.

EXIT STATUS

0   Success

1   Any error following successful command line processing. A message is printed to standard error.

If cmd is specified, pbs_attach waits for cmd to exit, then exits with the exit value of cmd.

If cmd is not specified, pbs_attach exits after attaching the session ID(s) to the job.

SEE ALSO
The PBS Professional Administrator's Guide
pbs_mom(8B), pbs_tmrsh(8B), setsid(2), tm(3)