Re: How to kill a background ssh process?



Darren Tucker wrote:
On 2006-08-18, clodoaldo.pinto@xxxxxxxxx <clodoaldo.pinto@xxxxxxxxx> wrote:
I need to have a background ssh tunnel.

It is setup like this:
$ ssh -n -N -C -o "StrictHostKeyChecking no" -L 5433:localhost:5432
1.2.3.4 &

It needs to eventually be killed and restarted with another server IP.
What I'm doing is sending it a SIGTERM and it works but leaves a
defunct process. This is not too big a deal but I want it clean.

So whatever's spawning ssh isn't catching the SIGCHLD when it exits and
wait()ing for the exit status?

Exactly. I just wait()ed for the exit status and all is good now.

Thanks, Clodoaldo PInto

.



Relevant Pages

  • RE: Auto logoff problem
    ... This should only happen when you start the application and exit it ... MCSE, CCEA, Microsoft MVP - Terminal Server ... with 2003 and that it takes one minute for the session to end. ... This is setup ...
    (microsoft.public.windows.terminal_services)
  • Installation error
    ... Setup cannot continue. ... Press any key to Exit" ... this message displays when I put the Microsof Windows ... server 2003 Enterprise Edition in CD drive of server to ...
    (microsoft.public.windows.server.general)
  • Clickstream log of user activity
    ... I need to log and track all activity of visitors on my website., ... exit page. ... How do I setup my server to log a unique ...
    (microsoft.public.inetserver.iis)
  • Re: Threading Question
    ... server form via CTRl-C or some other means, the threads are left to do ... the worst thing being that the network connections to ... Then you can close your sockets and files. ... so the threads all exit when the main thread calls exit. ...
    (comp.lang.lisp)
  • TCP server eating up the whole CPU
    ... A TCP server using polland a threaded-client to send the messages to ... int main ... exit(EXIT_FAILURE); ... memset(&servaddr, '\0', sizeof(struct sockaddr_in)); ...
    (comp.unix.programmer)