pb with remote command cleanup



Hi,

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.

To cope with this probleme, I can use "-t" to force remote tty, and then child are killed but I think it's not a good solution. Furthermore, I can't assure that all users do remote execution using this parameter. As a result, there is a lot of useless resident program that run on hosts and use cpu cycles for nothing.


Thank you in advance

Mat
.



Relevant Pages

  • Re: [SLE] Remote desktop?!?
    ... You'll have a command line for the other machine in front of you. ... display will be tunnelled via the SSH connection to the client. ... This is, of course, the geek solution to remote execution of programs (It's ... a Linux list, you gotta expect that...). ...
    (SuSE)
  • SSH remote command execution exit status 255
    ... I've got a question dealing with remote execution of commands through ... Executing a command locally on a Unix box, ... Now if I execute the command on a remote sshd server with an ssh ...
    (comp.security.ssh)