pbs_attach.8B 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. .\" Copyright (C) 1994-2018 Altair Engineering, Inc.
  2. .\" For more information, contact Altair at www.altair.com.
  3. .\"
  4. .\" This file is part of the PBS Professional ("PBS Pro") software.
  5. .\"
  6. .\" Open Source License Information:
  7. .\"
  8. .\" PBS Pro is free software. You can redistribute it and/or modify it under the
  9. .\" terms of the GNU Affero General Public License as published by the Free
  10. .\" Software Foundation, either version 3 of the License, or (at your option) any
  11. .\" later version.
  12. .\"
  13. .\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
  14. .\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  15. .\" FOR A PARTICULAR PURPOSE.
  16. .\" See the GNU Affero General Public License for more details.
  17. .\"
  18. .\" You should have received a copy of the GNU Affero General Public License
  19. .\" along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. .\"
  21. .\" Commercial License Information:
  22. .\"
  23. .\" For a copy of the commercial license terms and conditions,
  24. .\" go to: (http://www.pbspro.com/UserArea/agreement.html)
  25. .\" or contact the Altair Legal Department.
  26. .\"
  27. .\" Altair’s dual-license business model allows companies, individuals, and
  28. .\" organizations to create proprietary derivative works of PBS Pro and
  29. .\" distribute them - whether embedded or bundled with other software -
  30. .\" under a commercial license agreement.
  31. .\"
  32. .\" Use of Altair’s trademarks, including but not limited to "PBS™",
  33. .\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
  34. .\" trademark licensing policies.
  35. .\"
  36. .TH pbs_attach 8B "17 October 2017" Local "PBS Professional"
  37. .SH NAME
  38. .B pbs_attach
  39. \- attach a session ID to a PBS job
  40. .SH SYNOPSIS
  41. .B Linux
  42. .br
  43. .B pbs_attach
  44. [-j <job ID>] [-m <port>] -p <PID>
  45. .br
  46. .B pbs_attach
  47. [-j <job ID>] [-m <port>] [-P] [-s] <cmd> [<arg> ...]
  48. .br
  49. .B pbs_attach
  50. --version
  51. .B Windows
  52. .br
  53. .B pbs_attach
  54. [-c <path to script>] [-j <job ID>] [-m <port>] -p <PID>
  55. .br
  56. .B pbs_attach
  57. [-c <path to script>] [-j <job ID>] [-m <port>] [-P] [-s]
  58. .RS 11
  59. <cmd> [<arg> ...]
  60. .RE
  61. .br
  62. .B pbs_attach
  63. --version
  64. .SH DESCRIPTION
  65. The
  66. .B pbs_attach
  67. command associates the processes in a session with
  68. a PBS job by attaching the session ID to the job. This allows PBS MoM
  69. to monitor and control those processes.
  70. MoM uses process IDs to determine session IDs, which are
  71. put into MoM's task list (attached to the job.) All process IDs in
  72. a session are then associated with the job.
  73. When a command
  74. .I cmd
  75. is given as an operand,
  76. the
  77. .B pbs_attach
  78. process becomes the parent process of
  79. .I cmd,
  80. and the session ID of
  81. .B pbs_attach
  82. is attached to the job.
  83. .SH OPTIONS
  84. .IP "-c <path to script>" 15
  85. Windows only. Specified command is invoked using a new command shell.
  86. In order to spawn and attach built-in DOS commands such as set or
  87. echo, it is necessary to open the task using a
  88. .I cmd
  89. shell. The new
  90. command shell,
  91. .I cmd.exe
  92. , is attached as a task to the PBS job. The
  93. .B pbs_attach
  94. command spawns a program using a new command shell when
  95. attaching a batch script, or when invoked with the
  96. .I -c
  97. option.
  98. .IP "-j <job ID>" 15
  99. The job ID to which the session ID is to be attached.
  100. If
  101. .I job ID
  102. is not specified,
  103. a best effort is made to determine the job to which to attach
  104. the session.
  105. .IP "-m <port>" 15
  106. The port at which to contact MOM. Default: value of PBS_MANAGER_SERVICE_PORT
  107. from pbs.conf
  108. .IP "-p <PID>" 15
  109. Process ID whose session ID is to be attached to the job.
  110. Default: process ID of pbs_attach.
  111. Cannot be used with the
  112. .I -P
  113. or
  114. .I -s
  115. options or the
  116. .I cmd
  117. operand.
  118. .IP "-P" 15
  119. Attach sessions of both
  120. .B pbs_attach
  121. and the parent of
  122. .B pbs_attach
  123. to job.
  124. When used with
  125. .I -s
  126. option,
  127. the sessions of the new
  128. .B fork()
  129. ed
  130. .B pbs_attach
  131. and its parent, which is
  132. .B pbs_attach,
  133. are attached to the job. Cannot be used with the
  134. .I -p
  135. or
  136. .I -s
  137. options or the
  138. .I cmd
  139. operand.
  140. .IP "-s" 15
  141. Starts a new session and attaches it to the job:
  142. .B pbs_attach
  143. calls
  144. .B fork(),
  145. then the child
  146. .B pbs_attach
  147. first calls
  148. .B setsid()
  149. and then calls
  150. .B tm_attach
  151. to attach the new session to the job. The session ID of the new
  152. .B pbs_attach
  153. is attached to the job.
  154. .IP "--version" 15
  155. The
  156. .B pbs_attach
  157. command returns its PBS version information and exits.
  158. This option can only be used alone.
  159. .SH OPERANDS
  160. .IP "cmd" 15
  161. Name of command whose process ID is to be associated with the job.
  162. .SH EXIT STATUS
  163. .IP "0" 15
  164. Success
  165. .IP "1" 15
  166. Any error following successful command line processing.
  167. A message is printed to standard error.
  168. .LP
  169. If
  170. .I cmd
  171. is specified,
  172. .B pbs_attach
  173. waits for
  174. .I cmd
  175. to exit, then exits with the exit value of
  176. .I cmd.
  177. .LP
  178. If
  179. .I cmd
  180. is not specified,
  181. .B pbs_attach
  182. exits after attaching the session ID(s) to the job.
  183. .SH SEE ALSO
  184. The
  185. .B PBS Professional Administrator's Guide
  186. .br
  187. pbs_mom(8B), pbs_tmrsh(8B), setsid(2), tm(3)