Sponsored Content
Full Discussion: ssh hangs on exit
Top Forums Shell Programming and Scripting ssh hangs on exit Post 302552634 by l_gshankar24 on Monday 5th of September 2011 03:09:23 AM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
SSH-ARGV0(1)                                                BSD General Commands Manual                                               SSH-ARGV0(1)

NAME
ssh-argv0 -- replaces the old ssh command-name as hostname handling SYNOPSIS
hostname | user@hostname [-l login_name] [command] hostname | user@hostname [-afgknqstvxACNTX1246] [-b bind_address] [-c cipher_spec] [-e escape_char] [-i identity_file] [-l login_name] [-m mac_spec] [-o option] [-p port] [-F configfile] [-L port:host:hostport] [-R port:host:hostport] [-D port] [command] DESCRIPTION
ssh-argv0 replaces the old ssh command-name as hostname handling. If you link to this script with a hostname then executing the link is equivalent to having executed ssh with that hostname as an argument. All other arguments are passed to ssh and will be processed normally. OPTIONS
See ssh(1). FILES
See ssh(1). AUTHORS
OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo de Raadt and Dug Song removed many bugs, re-added newer features and created OpenSSH. Markus Friedl contributed the support for SSH protocol versions 1.5 and 2.0. Jonathan Amery wrote this ssh-argv0 script and the associated documentation. SEE ALSO
ssh(1) Debian Project September 7, 2001 Debian Project
All times are GMT -4. The time now is 01:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy