ssh hangs on exit


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ssh hangs on exit
# 1  
Old 09-05-2011
Java ssh hangs on exit

Hi,

Any workaround for this issue, since i am using one script to execute the remote script for several remote server, everything works fine except some of the servers process are hangs even its completed.


---Please help me to resolve this issue----

Script details are here..

Code:
for host in `cat host.txt | grep -v '#'`
do
/usr/bin/ssh -x -q prod@$host "
if ( ps -fu prod | egrep '[ /]bounce\\.ksh|[ /]prod_down\\.sh|[ /]PCFN\\.rc' | egrep -v 'grep|ps' )
then
echo \"\\nWARNING:bounce.ksh or prod_down.sh or PCFN.rc is already running. Exiting...\"
else
print -n \"Start at \"; date
. ./.profile 2>&1
bounce.ksh y 2>&1
print -n \"Ended at \";date
fi
" | tee ${host}.log >/dev/null 2>&1 & 
done


Last edited by pludi; 09-05-2011 at 04:14 AM.. Reason: adding script code
# 2  
Old 09-05-2011
This question should be under the scripting section
# 3  
Old 09-05-2011
thanks, will post this to script scection

Moderator's Comments:
Mod Comment Moved. Also, we don't allow double posting (see rule #4).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

ssh problem - hangs and then wont connect

Got a Solaris 10 server with two interfaces - 10.0.110.233 and 10.0.111.233. I can ssh to 10.0.110.233 with no problems. But after a certain amount of time it just hangs. Nothing. Then if I try to ssh to 10.0.110.233 again - times out. But I can still ssh to 10.0.111.233. And I can still ping... (1 Reply)
Discussion started by: psychocandy
1 Replies

2. Shell Programming and Scripting

ssh hangs on exit

Hi, Any workaround for this issue, since i am using one script to execute the remote script for several remote server, everything works fine except some of the servers process are hangs even its completed. ---Please help me to resolve this issue---- Script details are here.. Code:... (0 Replies)
Discussion started by: l_gshankar24
0 Replies

3. Shell Programming and Scripting

Piped output from SSH tunnel hangs?

Hi All, When starting an SSH tunnel, piped output 'hangs' (on AIX) : ssh -Nf -Llocalhost:22000:server:22 proxy | cat -vet - ... hangs ... Does anybody know how to prevent this? Of course, in my script I don't use the tunnel as I do in the example above. In my script the call to ssh is... (7 Replies)
Discussion started by: whbos
7 Replies

4. UNIX for Advanced & Expert Users

SSH hangs

Hi all, At a little bit of loss here. I have a Linux box (Redhat Enterprise 4) that has been working flawlessly for a while, that is until late Tuesday when none of the users could ssh into it. The machine is in a DMZ over which I have no control of the network settings. Here is the debug output... (6 Replies)
Discussion started by: ccj4467
6 Replies

5. AIX

SSH login hangs, serial console works

Server, running AIX 6.1 developed strange problem when logging in via SSH -- ssh client hangs without any error. It is possible to run commands on server, using ssh ("ssh servername ls -l" is OK) It is possible to log in normally, using serial console connected to server. It was possible to... (2 Replies)
Discussion started by: ivar.zarans
2 Replies

6. UNIX for Dummies Questions & Answers

X11 hangs on exit

Hi all, does anyone know an easy to read manual for newbies introducing X11 - more specifically how to open windows, resizing them, etc...? I namely installed FreeBSD 7.0 on an old HP omnibook xe4100 notebook because it's less demanding in resources. So far so good, everything went smooth... (0 Replies)
Discussion started by: erparis
0 Replies

7. UNIX for Advanced & Expert Users

ssh + clearcase hangs

Hi, prefix: cleartool is an clearcase command. clearcase is a control version tool I have setup a passwordless ssh connection between Unix machines A and B. I am executing a ssh command from Unix box 'A' to Unix box 'B' as follows. ssh username@B 'ls /home/username' This works perfectly... (2 Replies)
Discussion started by: sunilav
2 Replies

8. Shell Programming and Scripting

SSH to a server and exit out

Hi, Can someone please help me in resolving this issue - I am doing SSH from a server 1 to another server 2 and executing some statements there and then automatically exit out of second server to the first where script was getting executed. Can you please help me script this code ? Thanks (3 Replies)
Discussion started by: rajpuneyani
3 Replies

9. Solaris

script hangs-up at exit

I have a script that runs in verbose mode. At the end of the script it displays the final "exit" but then it hangs. What's going on?:( (5 Replies)
Discussion started by: davels
5 Replies

10. UNIX for Advanced & Expert Users

How to exit ssh

Hi, I have a script that runs ssh to multiple systems. It does the folowing : ssh -f -T server1 "/sbin/init.d/logsurfer newstart" Running it using the -f option at least the prompt gets back, running it without the -f the prompt does not even show up. You have to press <Ctrl> + c to get the... (1 Reply)
Discussion started by: davidg
1 Replies
Login or Register to Ask a Question