![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to set timeout? | uativan | Shell Programming and Scripting | 14 | 02-02-2009 02:28 AM |
| RPC Timeout | darren.wyatt | Red Hat | 1 | 09-09-2008 12:14 PM |
| ssh/scp - can you specify timeout? | frustrated1 | Shell Programming and Scripting | 3 | 01-02-2008 07:57 PM |
| About the Timeout | lyh003473 | SUN Solaris | 4 | 07-24-2004 09:12 PM |
| timeout | csaunders | HP-UX | 5 | 02-27-2004 10:54 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
RSH Timeout
Hi All
I have a nice little script that i have written in Perl, in it use RSH ( yes i know it is i should being using ssh, but it i secure network it is being run on) the idea of the script it that it will RSH into a machine and then follow out a command, the problem i am running into is if the RSH deamon for what ever reason as stopped working on the machine, the script will keep trying to accsess the machine for a few mins and then move onto the next, is there a way to add a timeout, so if the connect is not made in say 30 seconds it will move on thanks John |
|
||||
|
I would try to do the following (Im a beginner
) -Code:
CHK=`ssh2 -q <IP> "ps -ef | grep rshd | grep -v grep"`
if [ $CHK -eq 0 ]; then
sleep 30
CHK=`ssh2 -q <IP> "ps -ef | grep rshd | grep -v grep"`
if [ $CHK -ne 0 ];then
//call your script here
else
//rshd in remote sys is not up
//do what you want to
fi
else
//rshd running - call your script here too
fi
|
|
||||
|
i could be wrong but is that not just using ssh instead to check to make sure rsh is running??
I do not really care that it is not running, i just want the script to pass over that machine and carry on with the other machines in the list. thanks John |
|
|||||
|
rsh itself apparently doesn't support a timeout. If you've got netcat available, you could use this
Code:
netcat -z -w 3 remote 514 Or use IO::Socket::INET to open a connection yourself with a timeout and check that. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|