Connect to a job execution host or container
Use the battach command to connect (attach) to a job execution host or container for debugging or general connectivity purposes.
Procedure
-
Use the battach command with no options to connect to the job execution host
or container for the specified job ID with the default options.
battach job_id
battach job_id[job_index]
Runs an interactive /bin/sh shell to connect to the first job execution host or container for the specified job.
-
Use the battach -L command option or the
LSB_BATTACH_DEFAULT_SHELL environment variable to specify an alternate
interactive shell process.
- battach -L "shell_path" job_id
- battach -L "shell_path" job_id[job_index]
- LSB_BATTACH_DEFAULT_SHELL="shell_path"
The path that you specify must be an absolute file path. Relative file paths are not valid. If you specify a binary file instead of a shell, battach runs the specified binary file and exits.
The battach -L command option overrides the LSB_BATTACH_DEFAULT_SHELL environment variable.
-
For Docker parallel jobs, use the battach -m command option to specify the
job execution host or container.
battach -m "host_name" job_id
The host that you specify must be one of the execution hosts for the Docker parallel job.
For all other jobs (such as Docker sequential jobs or non-Docker jobs), you can only connect to the first job execution host or container.