<?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: how to set timeout in shell script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-set-timeout-in-shell-script/m-p/3351665#M870089</link>
    <description>Start connect_db in the background and run the checks in the script&lt;BR /&gt;&lt;BR /&gt;while read host&lt;BR /&gt;do&lt;BR /&gt;  connect_db &amp;amp;&lt;BR /&gt;  PID=$!&lt;BR /&gt;  sleep 10&lt;BR /&gt;  kill -0 $PID &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;  [ $? -eq 0 ] &amp;amp;&amp;amp; kill $PID&lt;BR /&gt;done&lt;BR /&gt;</description>
    <pubDate>Fri, 06 Aug 2004 13:36:53 GMT</pubDate>
    <dc:creator>Sundar_7</dc:creator>
    <dc:date>2004-08-06T13:36:53Z</dc:date>
    <item>
      <title>how to set timeout in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-set-timeout-in-shell-script/m-p/3351662#M870086</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am writing a script to connect to databases on remote servers. Something the script hang will attemp to connect the the databases. I would like to set timeout if attemp to connect to the database exceed 10 secs and move to the next one.&lt;BR /&gt;&lt;BR /&gt;i.e:&lt;BR /&gt;&lt;BR /&gt;while read host&lt;BR /&gt;do&lt;BR /&gt;connect_db&lt;BR /&gt;done &amp;lt; hosts.lst&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Aug 2004 13:01:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-set-timeout-in-shell-script/m-p/3351662#M870086</guid>
      <dc:creator>Ridzuan Zakaria</dc:creator>
      <dc:date>2004-08-06T13:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to set timeout in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-set-timeout-in-shell-script/m-p/3351663#M870087</link>
      <description>I don't know how to do that in the shell script.&lt;BR /&gt;&lt;BR /&gt;What is connect_db? Can the functionality be built into that?&lt;BR /&gt;&lt;BR /&gt;I'll give you an example of how it works.&lt;BR /&gt;&lt;BR /&gt;ping has a timeout command line option in it.&lt;BR /&gt;&lt;BR /&gt;ping -m 10 target&lt;BR /&gt;&lt;BR /&gt;That says try the ping for 10 seconds and then give up.&lt;BR /&gt;&lt;BR /&gt;I'll be watching this thread to learn.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Fri, 06 Aug 2004 13:17:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-set-timeout-in-shell-script/m-p/3351663#M870087</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-08-06T13:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to set timeout in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-set-timeout-in-shell-script/m-p/3351664#M870088</link>
      <description>Hi, the connect_db function is actually run the following command to check Oracle listener trace level on the remote servers.&lt;BR /&gt;&lt;BR /&gt;However on some servers the following command run forever:&lt;BR /&gt;&lt;BR /&gt;lsnrctl show trc_level&lt;BR /&gt;&lt;BR /&gt;I would like to skip any servers that take longer than 10 sec to run the above command. &lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Fri, 06 Aug 2004 13:28:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-set-timeout-in-shell-script/m-p/3351664#M870088</guid>
      <dc:creator>Ridzuan Zakaria</dc:creator>
      <dc:date>2004-08-06T13:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to set timeout in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-set-timeout-in-shell-script/m-p/3351665#M870089</link>
      <description>Start connect_db in the background and run the checks in the script&lt;BR /&gt;&lt;BR /&gt;while read host&lt;BR /&gt;do&lt;BR /&gt;  connect_db &amp;amp;&lt;BR /&gt;  PID=$!&lt;BR /&gt;  sleep 10&lt;BR /&gt;  kill -0 $PID &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;  [ $? -eq 0 ] &amp;amp;&amp;amp; kill $PID&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Aug 2004 13:36:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-set-timeout-in-shell-script/m-p/3351665#M870089</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2004-08-06T13:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to set timeout in shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-set-timeout-in-shell-script/m-p/3351666#M870090</link>
      <description>I don't think there is an easy way to do this the you want.. or may be there is some still undiscovered sheel options somewhere to get what you wanted. &lt;BR /&gt;But here is few things that came to my mind to tackle the rpoblem.&lt;BR /&gt;&lt;BR /&gt;1. You may probably want to find out why the 'lsnrctl' command is hangign in the first place. IT may be related to some buggy code or require a patch or something.&lt;BR /&gt;&lt;BR /&gt;2. Or may be it's related to some poor netork (tcp/ip) settings. In that case you may be able to tune some ndd paramteres like&lt;BR /&gt;tcp_ip_abort_cinterval etc. (look at ndd -h to see all supported ndd tunable paramteres).&lt;BR /&gt;This might help set the timeout value to what you are looking for.&lt;BR /&gt;&lt;BR /&gt;3. In a shell scripting perspective, I would probabley run the command in the background and do sleep for 10 seconds and would kill it with kill -9 if still hanging. Just a workaround.&lt;BR /&gt;or as a last resort,&lt;BR /&gt;4. Continue looking for a ksh timeout value ..:-&lt;BR /&gt;&lt;BR /&gt;reds,&lt;BR /&gt;Abdul.</description>
      <pubDate>Fri, 06 Aug 2004 13:42:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-set-timeout-in-shell-script/m-p/3351666#M870090</guid>
      <dc:creator>Abdul Rahiman</dc:creator>
      <dc:date>2004-08-06T13:42:37Z</dc:date>
    </item>
  </channel>
</rss>

