2

When a command is submitted with bsub, it will start a process with res command. res in turn will start actual command as another process

I want to know pid of this actual command

let's say, I have submitted this command. With bhist -l jobid, we can know pid of res, but unable to find a way to get pid of virtuoso

bsub -I -q interactive virtuoso &

1 Answers1

0

If you run a script that calls virtuoso, you should be able to capture the PID of virtuoso from the script and then output it, something like this should work:

#!/bin/bash
jobs &>/dev/null
virtuoso &
new_job_started="$(jobs -n)"
if [ -n "$new_job_started" ];then
    VAR=$!
else
    VAR=
fi
echo $VAR

I don't know how useful this will be, since you probably won't be on the same machine that your interactive shell is running so you won't be able to access the process with the pid.