battach

Runs a shell process to connect to an existing job execution host or container.

Synopsis

battach [-m "host_name"] [-L "shell_path"] job_ID | job_ID[index_list]
battach [-h | -V]

Description

Use the battach command to directly connect (attach) to an execution host or Docker container for the specified job for debugging purposes, or for general connectivity. Once connected, you can run shell commands from the interactive command line.

battach runs the interactive /bin/sh shell by default as the job submission user on the execution host to manage input and output between the user and the job execution host. Use the -L option to specify an alternate shell. LSF puts the shell process that battach starts into the job cgroup on the execution host. The shell process owner is the job submission user.

For non-Docker sequential jobs, the battach command attaches to the job execution host. For non-Docker parallel jobs, the battach command attaches to the first execution host, or use the battach -m command option to attach to the specified execution host.

For Docker sequential jobs, there is one job container on the execution host. battach runs the docker exec job_container_id command to attach to the job container as the job submission user to manage input and output between the user and the job execution host. LSF puts the shell process that battach starts into the job cgroup on the execution host. The process owner is the starter or context user that is defined in the corresponding application profile.

For Docker parallel jobs, there are two types of containers on the execution host: single-job containers, and multi-task containers. By default, battach also runs the docker exec job_container_id command to attach to the job container as the job submission user to manage input and output between the user and the job execution host. To attach to a task container, specify the -m option and battach attaches to the task container with the smallest task ID by running the docker exec task_container_id command and managing input and output between the user and the job execution host, with the job submission user as the login user. LSF puts the shell process that battach starts into the task cgroup on the execution host. The process owner is the starter or context user that is defined in the corresponding application profile.

Options

-m "execution_host"
For parallel jobs, specifies the job execution host (for non-Docker jobs) or the job container on the job execution host (for Docker jobs) to which battach connects. The host that you specify must be one of the job execution hosts for the parallel job.
-L "shell_path"
Specifies the shell that battach launches in the job execution host or container. 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.

By default, this is the /bin/sh shell. If the LSB_BATTACH_DEFAULT_SHELL environment variable is defined, LSB_BATTACH_DEFAULT_SHELL overrides this default value, and the battach -L command option overrides the value of the LSB_BATTACH_DEFAULT_SHELL environment variable.

job_id | job_id[job_index]
Connects to the job execution host or container for this job ID or job array element. You cannot specify a job array, nor can you specify a job that is not running.
-h

Prints command usage to stderr and exits.

-V

Prints product release version to stderr and exits.