[svlug] SSH not disconnecting properly
Mark
msalists at gmx.net
Fri Jul 21 12:55:58 PDT 2006
Hi,
I have a problem when closing a ssh session under a particular scenario. This is under Fedora Core 3.
I use putty to open a ssh session on the gateway server, from there I ssh into the webserver.
On the webserver, I use catalina.sh to start Tomcat. Within the catalina.sh script, I made one modification: I changed the end of
the line that calls the java VM and redirects the output to a file using
".... 2>&1 >> catalina.out &"
to this
".... 2>&1 | /usr/sbin/rotatelogs catalina.%m%d%y.out 86400 &"
I did this so that the output goes through Apache's rotatelogs program in order to prevent problems with forever-growing
catalina.out files. That works nicely, the only problem I have is that everytime I log into the system using ssh in order to
(re)start Tomcat, the ssh session does not properly disconnect when I log out (usually I use CTRL-D). The session ends, the screen
clears and then stays on that clear screen rather than dropping me off on the shell of the gateway server that I logged in from. If
I close putty, it asks me if I want to disconnect the current session.
This did not happen before I changed catalina.sh, so it must somehow be related to either rotatelogs or the way Tomcat is started
and kept running after logout by using the ampersand at the end op the line.
If I open another ssh session to that webserver and check how many sshd processes are running, it seems like the previous one that I
used to (re)start Tomcat is not there any more. So the disconnect seems to get far enough to stop the sshd process on the webserver.
Tomcat keeps running even when I shut down putty, so it seems like no harm is done on any of the involved machines.
Does anybody know why exactly this happens and how I can fix it? Is there any potential problem if I can nto find a solution and
just keep on shutting putty down altogether?
Thanks,
MARK
More information about the svlug
mailing list