I am firing up an ssh command that will fork itself out and will be running even after the script is done. So the code looks like this:
ssh_proc = Popen(['ssh', '-f', '-N', '-L', local_forward, local_user_host], stdin=PIPE, stdout=PIPE)
print ssh_proc.pid
stat = ssh_proc.poll()
As you can see ssh -f
forks ssh as a process and runs after the script is done - i need to get the pid of that ssh process. The print statement above, will only print out the pid of Popen process. Any suggestions?>