You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Maarten Smit (JIRA)" <ji...@apache.org> on 2012/09/18 17:05:08 UTC

[jira] [Comment Edited] (SSHD-188) Session timeout doesn't call destroy() from InvertedShell

    [ https://issues.apache.org/jira/browse/SSHD-188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13457874#comment-13457874 ] 

Maarten Smit edited comment on SSHD-188 at 9/19/12 2:04 AM:
------------------------------------------------------------

I'm using the latest, 0.7.0
It could be a combination of the client / server problem. I tested it using Putty and Absolutetelnet

So on Putty I did this:
- Set server to timeout after 30 sec
- start putty, login
- send ls command
- wait for timeout
- putty tells connection gave a timeout (after the 30 sec)
->the destroy function is never called

So could you maybe test it on putty?

---
Or do you mean with the laster, the test version of 0.8.0? Because I didn't try that one, I'm using the 0.7.0 library

                
      was (Author: maarten1):
    I'm using the latest, 0.7.0
It could be a combination of the client / server problem. I tested it using Putty and Absolutetelnet

So on Putty I did this:
- Set server to timeout after 30 sec
- start putty, login
- send ls command
- wait for timeout
- putty tells connection gave a timeout (after the 30 sec)
->the destroy function is never called

So could you maybe test it on putty?

                  
> Session timeout doesn't call destroy() from InvertedShell
> ---------------------------------------------------------
>
>                 Key: SSHD-188
>                 URL: https://issues.apache.org/jira/browse/SSHD-188
>             Project: MINA SSHD
>          Issue Type: Bug
>         Environment: Windows, Linux
>            Reporter: Maarten Smit
>              Labels: close, destroy,, idle,, shell, timeout,
>
> When creating the ssh server I have this:
> sshd.setShellFactory(new PseudoTerminalFactory("/system/bin/sh", "-i"));
> The PseudoTerminalFactory has this:
>     @Override
>     public Command create() {
>         return new InvertedShellWrapper(new PseudoTerminal());
>     }
> And the "PseudoTerminal implements InvertedShell" contains the following
> functions:
> destroy()
> exitValue()
> getErrorStream()
> getInputStream()
> getOutputStream()
> isAlive()
> start(Map<String, String> env)
> Now here is the thing, when a session is created and the user:
> - closes it
> - or the server is stopped
> The destroy and exitValue functions are being called. In the destroy
> function we stop the shell process (which is started in the start function).
> However, if a user has a shell connection and doesn't do anything, default
> after 10 minutes the idletimeout will have passed and the user gets a
> timeout error and gets disconnected. HOWEVER, after that the destroy and
> exitValue are never called, so the isAlive function will continue being
> called (always returns true till the destroy function is called) and we
> will have an endless running thread.
> Next time we start the server we get an error the port is in use, etc. And
> all the time the checking of isAlive of that session will just continue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira