Silly SSH question
John Chambers
jc at trillian.mit.edu
Sat Apr 2 15:26:36 EST 2005
| On Sat, Apr 02, 2005 at 02:10:13PM -0500, dsr at tao.merseine.nu wrote:
| > On Sat, Apr 02, 2005 at 01:59:08PM -0500, Derek Martin wrote:
| > > On Sat, Apr 02, 2005 at 01:36:31PM -0500, Josh Pollak wrote:
| > > > The question is, how do I cleanly kill this tunnel? I've been running
| > > > 'ps aux | grep ssh', finding the line and killing it, but that seems
| > > > kludgy. Is there a 'right way' to do this?
| > >
| > > Yeah, you just named it. ;-) Seriously... there isn't any other way.
| >
| > You know better than to say things like that.
|
...
| Therefore, the basic metodology is, and can only be: 1. Use some
| program to find out what the pid is. 2. send a signal to that pid.
| Any of the practical variations you come up with will fit this pattern.
All this is where there are so many programs floating around like
this one in my collection:
http://trillian.mit.edu/~jc/sh/Kill
And I really should get around to rewriting it in perl. It's the most
complicated sh script that I still have, and it's dependent on the
vagaries of the ps command, which varies wildly on different unices.
Now that every unix-like system comes with perl, it's just laziness
that keeps this a sh script that needs tweaking on every system.
There must be a zillion scripts like this Out There ...
More information about the Discuss
mailing list