Re: pb with remote command cleanup
- From: Mat <matthieu.hautreux@xxxxxxxxxxx>
- Date: Wed, 20 Jun 2007 23:24:37 +0200
Thank you for your help but my problem is not a connection problem. I'm worrying about the remaining command that is still running on the remote side after connection lost.
Keepalives enable me to kill connection sooner or later but doesn't guarantee any remote command destruction and that is the real problem : if a user launch, using ssh, a remote process that is CPU intensive and then kill his terminal (or hit ctrl-C), the CPU intensive task is still running on the remote side despite the lost of the connection.
I'm looking for a way to handle remote command destruction after connection lost ? Maybe an sshd_config parameter ? Maybe a patch ?
Thanks
Darren Dunham a écrit :
Mat <matthieu.hautreux@xxxxxxxxxxx> wrote:.I have a cleanup problem when I remote execute a command using ssh. If I kill ssh client during remote execution (with ctrl-C or by closing the terminal) then remote command still exists.
Here is what's happening :
[mat@myfirsthost ~]$ ssh mysecondhost sleep 3600
Killed by signal 2.
[mat@myfirsthost ~]$ ssh mysecondhost ps -fu mat | grep sleep
mat 3570 1 0 22:04 ? 00:00:00 sleep 3600
mat 3685 3492 0 22:09 pts/1 00:00:00 grep sleep
Is there a way for sshd to kill all childs when connection is closed/lost ? Maybe there is an option in sshd_config that can do it but I didn't find any.
You can set keepalives (like ClientAliveInterval/ClientAliveCountMax).
If the client isn't heard from, then it will poll and eventually kill
the connection if the client doesn't respond.
Don't set them too low or it will kill the connection even during
temporary network outages.
Most idle sshd processes don't take up much resources (certainly not
much CPU), so I'd normally set the time limit several hours or greater.
Your environment may demand otherwise.
- Follow-Ups:
- Re: pb with remote command cleanup
- From: Darren Dunham
- Re: pb with remote command cleanup
- References:
- pb with remote command cleanup
- From: Mat
- Re: pb with remote command cleanup
- From: Darren Dunham
- pb with remote command cleanup
- Prev by Date: Re: Putty PSFTP hangs on bad username/password?
- Next by Date: prompt or not prompt for the password depending on the user
- Previous by thread: Re: pb with remote command cleanup
- Next by thread: Re: pb with remote command cleanup
- Index(es):
Relevant Pages
|
|