After sessions that last longer that ca. 15 minutes, my Putty window doesn't close after logout. This happens not every time, of
course. The session configuration is set to "close on clean exit".
This is the event log:
2002-06-05 14:43:05 Looking up host "xxxxxxxxxx"
2002-06-05 14:43:05 Connecting to xxxxxxxxx port 22
2002-06-05 14:43:06 Server version: SSH-2.0-OpenSSH_3.0.2p1 Debian 1:3.0.2p1-9
2002-06-05 14:43:06 We claim version: SSH-2.0-PuTTY-Release-0.52
2002-06-05 14:43:06 Using SSH protocol version 2
2002-06-05 14:43:06 Doing Diffie-Hellman group exchange
2002-06-05 14:43:06 Doing Diffie-Hellman key exchange
2002-06-05 14:43:11 Host key fingerprint is:
2002-06-05 14:43:11 ssh-rsa 1024 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2002-06-05 14:43:11 Initialised zlib (RFC1950) compression
2002-06-05 14:43:11 Initialised zlib (RFC1950) decompression
2002-06-05 14:43:11 Initialised AES-256 client->server encryption
2002-06-05 14:43:11 Initialised AES-256 server->client encryption
2002-06-05 14:43:11 Pageant is running. Requesting keys.
2002-06-05 14:43:11 Pageant has 2 SSH2 keys
2002-06-05 14:43:11 Trying Pageant key #0
2002-06-05 14:43:12 Key refused
2002-06-05 14:43:12 Trying Pageant key #1
2002-06-05 14:43:12 Sending Pageant's response
2002-06-05 14:43:12 Access granted
2002-06-05 14:43:12 Opened channel for session
2002-06-05 14:43:12 Allocated pty
2002-06-05 14:43:12 Started a shell/command
2002-06-05 15:17:23 Server sent command exit status 0
At this point, the window stays open. If I click the close box, the normal "Are you sure you want to close this session" prompt
appears.
Any pointers?
Thanks in advance!
Beat Bolli
I doubt the session length is the problem here. I think it's more
likely that at some point during the session, you're starting a
process in the background, which keeps the terminal device open even
after the foreground processes (including the shell) have terminated.
If I'm right, then this is an SSH server problem - PuTTY closes the
session when the server tells it it's finished, so if PuTTY isn't
closing then the server isn't telling it it's finished. Try the same
test with a different SSH client and you'll probably find it doesn't
depend on whether you're using PuTTY or not.
I believe OpenSSH changed its behaviour on this point at some stage,
though I don't recall exactly when.
Here's a good test: when you log in, type `tty' to find out your
terminal device. Then, once you get a session that won't die, leave
it there, start another session alongside it, and use `ps -x' to
find out if any processes are still using the terminal device from
the first session.
--
Simon Tatham "My heart bleeds.
<ana...@pobox.com> (That's how it works.)" -- Gareth Taylor
You're right!
I did indeed start a background process. ps shows '?' as the TTY, but lsof clearly displays the /dev/pts/xx file still open on
stdout and stderr. A little output redirection, and everything's fine.
Thanks for the quick reply!
Beat Bolli