<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Hang script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576366#M858533</link>
    <description>&lt;BR /&gt;Improved version.</description>
    <pubDate>Thu, 06 Sep 2001 15:45:17 GMT</pubDate>
    <dc:creator>Klaus Crusius</dc:creator>
    <dc:date>2001-09-06T15:45:17Z</dc:date>
    <item>
      <title>Hang script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576360#M858527</link>
      <description>I have simple script that goes and remsh to system but if system is in certain stat it will hang. how do I stop that&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;set systems= (client1 client2 client3)&lt;BR /&gt;foreach system ($systems)&lt;BR /&gt;   remsh $system echo $shell&lt;BR /&gt;end&lt;BR /&gt;&lt;BR /&gt;It hangs on client2. I can ping client2. I can't login because home is nfs mount. When I try telnet client2 it says trying ip...&lt;BR /&gt;&lt;BR /&gt;How do I stop this hanging and goes to client3?&lt;BR /&gt;&lt;BR /&gt;Sachin&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Sep 2001 14:09:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576360#M858527</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2001-09-06T14:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Hang script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576361#M858528</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;if it is not sure, that your remsh command returns properly, you'll need to start it in background with "&amp;amp;"&lt;BR /&gt;and record PID of background process (man csh).&lt;BR /&gt;&lt;BR /&gt;After this "sleep secs_long_enough"&lt;BR /&gt;&lt;BR /&gt;After this check if PID still active and if yes, kill it and take a status-note.&lt;BR /&gt;&lt;BR /&gt;Porceed to next loop then.&lt;BR /&gt;&lt;BR /&gt;I am no csh-fan, so I have limits to give you a sample, but this should lead the way.&lt;BR /&gt;&lt;BR /&gt;Volker&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Sep 2001 15:15:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576361#M858528</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2001-09-06T15:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Hang script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576362#M858529</link>
      <description>You might want to try rexec instead of remsh.  It doesn't source profiles/environments and may work for you.</description>
      <pubDate>Thu, 06 Sep 2001 15:19:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576362#M858529</guid>
      <dc:creator>Tom Danzig</dc:creator>
      <dc:date>2001-09-06T15:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Hang script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576363#M858530</link>
      <description>Just remembered that rexec requires a password.  Ignore my previous suggestion.</description>
      <pubDate>Thu, 06 Sep 2001 15:21:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576363#M858530</guid>
      <dc:creator>Tom Danzig</dc:creator>
      <dc:date>2001-09-06T15:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Hang script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576364#M858531</link>
      <description>Hello I do remsh scripts but they dont hang even if the host is down. But here is how I do my list of many hosts.hostnames is a file in /home/richard/cron that has a list of the hosts in one column. Do you get any erros from your script?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;cd /home/richard/cron&lt;BR /&gt;HOSTNAME_FILE=hostnames&lt;BR /&gt;for host in $(cat $HOSTNAME_FILE)&lt;BR /&gt;do&lt;BR /&gt;echo $host&lt;BR /&gt;remsh $host -l root hostname&lt;BR /&gt;done&lt;BR /&gt;#### end of script&lt;BR /&gt;exit 0</description>
      <pubDate>Thu, 06 Sep 2001 15:24:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576364#M858531</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2001-09-06T15:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Hang script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576365#M858532</link>
      <description>The attached C-Program will start a process and kill it after 5 seconds.&lt;BR /&gt;&lt;BR /&gt;compile: cc -Aa killafter.c -o killuser&lt;BR /&gt;&lt;BR /&gt;usage in your application:&lt;BR /&gt;killafter remsh echo $shell&lt;BR /&gt;&lt;BR /&gt;Klaus</description>
      <pubDate>Thu, 06 Sep 2001 15:40:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576365#M858532</guid>
      <dc:creator>Klaus Crusius</dc:creator>
      <dc:date>2001-09-06T15:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Hang script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576366#M858533</link>
      <description>&lt;BR /&gt;Improved version.</description>
      <pubDate>Thu, 06 Sep 2001 15:45:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576366#M858533</guid>
      <dc:creator>Klaus Crusius</dc:creator>
      <dc:date>2001-09-06T15:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Hang script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576367#M858534</link>
      <description>Hi Sachin,&lt;BR /&gt;&lt;BR /&gt;You could try something like this&lt;BR /&gt;=========Cut here==============&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;&lt;BR /&gt;export systems = "client1 client2 client3"&lt;BR /&gt;&lt;BR /&gt;for i in $systems&lt;BR /&gt;do&lt;BR /&gt;  echo $i&lt;BR /&gt;  (remsh $i -n "echo $SHELL") &amp;amp;&lt;BR /&gt;   MYPID=$!&lt;BR /&gt;   # echo $MYPID&lt;BR /&gt;&lt;BR /&gt;   sleep 5&lt;BR /&gt;   ps -ef |grep -v grep |grep $MYPID &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;   if [ $? = 0 ]&lt;BR /&gt;   then&lt;BR /&gt;       echo "Connection to client $i is hung"&lt;BR /&gt;       kill $MYPID&lt;BR /&gt;    fi&lt;BR /&gt;done&lt;BR /&gt;=========Cut here==============&lt;BR /&gt;&lt;BR /&gt;-HTH&lt;BR /&gt;Ramesh</description>
      <pubDate>Thu, 06 Sep 2001 16:32:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576367#M858534</guid>
      <dc:creator>linuxfan</dc:creator>
      <dc:date>2001-09-06T16:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Hang script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576368#M858535</link>
      <description>Thanks all of you.&lt;BR /&gt;&lt;BR /&gt;I have a script that runs command1 and that commnad1 remsh for multiple systems. &lt;BR /&gt;&lt;BR /&gt;I will grep for command1's pid and then I will search for child pid of that pid and kill it if it hangs more then 5 seconds.&lt;BR /&gt;&lt;BR /&gt;R.U your solution is very much what I was looking for.&lt;BR /&gt;&lt;BR /&gt;Sachin&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Sep 2001 16:51:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576368#M858535</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2001-09-06T16:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Hang script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576369#M858536</link>
      <description>The original problem (hang on each remsh) is a classic due to the interactive nature of remsh.  The key is remsh -n which allows an async connection to the remote side.&lt;BR /&gt;&lt;BR /&gt;Attached is a script to ping a list of hosts from a file formatted like /etc/hosts, and specify how long to wait before giving up and killing the process.  It uses the shell's ability to return a background PID.</description>
      <pubDate>Thu, 06 Sep 2001 17:28:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576369#M858536</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2001-09-06T17:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Hang script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576370#M858537</link>
      <description>Bill, thanks for the script.  It works well, although I had to modify it for my system.  It looks like the ping command on my system does not accept -m option.  Is it only available with most recent versions of ping?  I have: &lt;BR /&gt;&lt;BR /&gt;# what /usr/sbin/ping&lt;BR /&gt;/usr/sbin/ping:&lt;BR /&gt;         PHNE_16158 ping.c $Revision: 1.8.119.5 $ $Date: 98/07/23 14:27:01 $&lt;BR /&gt;        NET:    Version: B.11.00  $Date: 97/10/15 10:44:23 $</description>
      <pubDate>Thu, 06 Sep 2001 19:15:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hang-script/m-p/2576370#M858537</guid>
      <dc:creator>Mladen Despic</dc:creator>
      <dc:date>2001-09-06T19:15:40Z</dc:date>
    </item>
  </channel>
</rss>

