pbs_attach(8B)

πŸ“¦ version 23.06.06-unstable-2026-04, in nixos 26.05, nixpkgs unstable

πŸ’– pbs_attach β€” attach a session ID to a PBS job πŸ’–

okay bestie, welcome to pbs_attach(8B) from PBS Professional β€” the little command that's gonna glue a whole session of processes to a PBS job so MoM can keep an eye on them. no cap, it's giving backstage-pass energy. ✨


✨ 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 πŸ¦‹

so the pbs_attach command associates the processes in a session with a PBS job β€” by attaching the session ID to the job. literally that's the whole vibe. this is what lets PBS MoM monitor and control those processes. πŸ‘‘

MoM uses process IDs to figure out session IDs, and those session IDs get put into MoM's task list (attached to the job). then all the process IDs in a session are associated with the job. fr fr, the whole squad gets linked up.

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. main character behavior tbh. πŸ’…


πŸ”₯ OPTIONS πŸ”₯

  • -c <path to script> β€” Windows only, bestie! the specified command gets invoked using a new command shell. if you wanna spawn and attach built-in DOS commands like set or echo, you need to open the task using a cmd shell. the new command shell, cmd.exe, is attached as a task to the PBS job. pbs_attach 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 that the session ID is gonna be attached to. if you don't specify a job ID, a best effort is made to determine the job to attach the session to. iykyk, it'll try its best. πŸ’–
  • -m <port> β€” the port where we contact MOM. default: the value of PBS_MANAGER_SERVICE_PORT from pbs.conf. ✨
  • -p <PID> β€” the process ID whose session ID is to be attached to the job. default: the process ID of pbs_attach. cannot be used with the -P or -s options or the cmd operand. pick a lane, babe. πŸ™ˆ
  • -P β€” attaches the sessions of both pbs_attach and the parent of pbs_attach to the job. when used with the -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. iconic fresh-start moment. 🌸
  • --version β€” pbs_attach returns its PBS version information and exits. this option can only be used alone, periodt. ⭐

🌈 OPERANDS 🌈

  • cmd β€” name of the 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 πŸ‘‘

pbs_mom(8B), pbs_tmrsh(8B), setsid(2), tm(3)


ngl bestie, if you're attaching sessions, double-check those incompatible flag combos β€” -p with -P/-s/cmd is a no, and -P with -p/-s/cmd is also a no. the manpage said it, not me. πŸ’…

and that's the whole page, fr fr! this local edition is dated 6 May 2020 β€” so cute, so classic. go attach those sessions and slay, bestie πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from