1831657 Members
2260 Online
110029 Solutions
New Discussion

Re: ssh hang

 
SOLVED
Go to solution
Ray Brewer
Valued Contributor

ssh hang

We are having a problem with ssh hanging in the following scenario:

1. Login to server A - either telnet, CDE, etc
2. ssh to server B - "ssh serverB"
3. Run a swinstall or launch an application
4. Exit from server b - either "exit" or "ctrl D"

While exiting server B the terminal session hangs and never returns to the command prompt on server A. You then need to kill the session on server B. After killing the session you are returned to a command prompt on server A. This only happens if you launch a daemon, start an application, or install a new application via swinstall. Other standard commands like cd ,mkdir, cat, etc. work fine. I think it has something to do with associating a process with a tty then trying to exit but am not sure. Any Ideas? Any help would be appreciated?
Thanks
Ray
6 REPLIES 6
Sanjay_6
Honored Contributor
Solution

Re: ssh hang

Hi Ray,

Did you leave a active process running over there on serverB

http://www.openssh.com/faq.html#3.10

Hope this helps.

Regds
Ray Brewer
Valued Contributor

Re: ssh hang

Sinjay,

Yes gernerally there is always a process such as a daemon started beforethe exit occurs. I will take a look at the link you provided.

Thanks!
Ray
Ray Brewer
Valued Contributor

Re: ssh hang

Sanjay,

Sorry for mis-spelling your name!!

Ray
Michael Selvesteen_2
Trusted Contributor

Re: ssh hang

Hi,

Try recent version of HP Secure Shell ( A.03.81.002). I tried out your scenario but it worked correctly for me.

I tried the following

# ssh sonnet
# sleep 20 &
[1] 7904
# exit
You have running jobs
# ctrl + D
logout root
Connection to sonnet closed.
#

--
M
logout root
Connection to sonnet closed.
NMCI Group
Advisor

Re: ssh hang

That doesn't seem to replicate the problem. If you were to type "ssh sonet 'sleep 20 & exit'" it would hang. Another way to replicate the issue is to ssh sonet, then mwa stop, then mwa start, assuming you have measureware. Then if you try to exit it hangs on me every time. I am running the most recent version of HPUX Secure Shell.
Ray Brewer
Valued Contributor

Re: ssh hang

We found a solution to our problem thanks to a little help from HP. We added this line to the script we were running and it worked to release the session.

exec > /dev/null < /dev/null 2>&1


Here is a sample script that illustrates how to place the entry into a script. The return code can be anything you want. We used 3 to help prove we could capture the return code we were looking for.

#!/bin/sh
exec > /dev/null < /dev/null 2>&1

sleep 30 &

return 3