[Bug 1473] Add option to save PID of a backgrounded ssh process

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Fri May 30 01:09:25 EST 2008


https://bugzilla.mindrot.org/show_bug.cgi?id=1473





--- Comment #3 from Tim Steiner <tsteiner at nerdclub.net>  2008-05-30 01:09:20 ---
Damien: Thanks for the tip.  I was unaware of ControlMasters.

Darren: Actually, since the ssh process is forking, the pid your script
saves is that of the parent process, and not the new child process.

I suppose something like this would work:

#!/bin/sh
echo $$ >pid.sh
exec ssh user at host -L 123:remote.host:456 -N

The downside is that you have to run it in the background, and ssh
won't be able to prompt for a password (if needed).

-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.


More information about the openssh-bugs mailing list