<?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: wait usage in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/wait-usage/m-p/4127363#M315764</link>
    <description>The key to this would be to store the PID of the application in a file during startup, then using the wait command in your shutdown script, referencing the PID file. &lt;BR /&gt;&lt;BR /&gt;wait `cat /tmp/PIDfile`&lt;BR /&gt;&lt;BR /&gt;By the way, wait only works on background processes so this may not be exactly what you wanted.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
    <pubDate>Thu, 10 Jan 2008 16:01:49 GMT</pubDate>
    <dc:creator>Pete Randall</dc:creator>
    <dc:date>2008-01-10T16:01:49Z</dc:date>
    <item>
      <title>wait usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/wait-usage/m-p/4127362#M315763</link>
      <description>&lt;BR /&gt;I am stopping an SAP application via a shutdown script, and then I want to unmount its filesystems.&lt;BR /&gt;&lt;BR /&gt;I want to make sure the application shutdown script completes successfully so that I won't have any issues unmounting the filesystems.&lt;BR /&gt;&lt;BR /&gt;How can I use the "wait" command for this purpose?&lt;BR /&gt;&lt;BR /&gt;I've always used "sleep" previously but wait seems to be smarter.&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jan 2008 15:56:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/wait-usage/m-p/4127362#M315763</guid>
      <dc:creator>dictum9</dc:creator>
      <dc:date>2008-01-10T15:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: wait usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/wait-usage/m-p/4127363#M315764</link>
      <description>The key to this would be to store the PID of the application in a file during startup, then using the wait command in your shutdown script, referencing the PID file. &lt;BR /&gt;&lt;BR /&gt;wait `cat /tmp/PIDfile`&lt;BR /&gt;&lt;BR /&gt;By the way, wait only works on background processes so this may not be exactly what you wanted.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 10 Jan 2008 16:01:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/wait-usage/m-p/4127363#M315764</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2008-01-10T16:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: wait usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/wait-usage/m-p/4127364#M315765</link>
      <description>Hi &lt;BR /&gt;wait can wait for a background process exit.&lt;BR /&gt;&lt;BR /&gt;so if you do &lt;BR /&gt;unmount /myfilesys &amp;amp;&lt;BR /&gt;echo unmounting&lt;BR /&gt;wait&lt;BR /&gt;echo umount result$?&lt;BR /&gt;&lt;BR /&gt;or &lt;BR /&gt;unmount /myfilesys &amp;amp;&lt;BR /&gt;umntpid=$!&lt;BR /&gt;echo unmounting&lt;BR /&gt;wait $umntpid&lt;BR /&gt;echo unmount result $?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jan 2008 16:06:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/wait-usage/m-p/4127364#M315765</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2008-01-10T16:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: wait usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/wait-usage/m-p/4127365#M315766</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;If you are simply running syhcnronous tasks:&lt;BR /&gt;&lt;BR /&gt;#/usr/bin/sh&lt;BR /&gt;/myshutdown_thing&lt;BR /&gt;[ $? -eq 0 ] &amp;amp;&amp;amp; echo "success!" || { echo "I failed!"; exit 1; }&lt;BR /&gt;echo "now unmounting"&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jan 2008 16:09:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/wait-usage/m-p/4127365#M315766</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-01-10T16:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: wait usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/wait-usage/m-p/4127366#M315767</link>
      <description>I am not sure what you mean by synchronous, I am running everything in a script:&lt;BR /&gt; the shutdown command &lt;BR /&gt;and then the umount&lt;BR /&gt;&lt;BR /&gt;I presume the above about exit code still applies.&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jan 2008 16:35:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/wait-usage/m-p/4127366#M315767</guid>
      <dc:creator>dictum9</dc:creator>
      <dc:date>2008-01-10T16:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: wait usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/wait-usage/m-p/4127367#M315768</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I am not sure what you mean by synchronous.&lt;BR /&gt;&lt;BR /&gt;Yes, one process after the other, seriallly, rather than in parallel.  For example:&lt;BR /&gt;&lt;BR /&gt;# cat ./parallel&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;( sleep 20; date ) &amp;amp;&lt;BR /&gt;T1=$!&lt;BR /&gt;echo "task-1 pid=${T1} started"&lt;BR /&gt;( sleep 10; date ) &amp;amp;&lt;BR /&gt;T2=$!&lt;BR /&gt;echo "task-2 pid=${T2} started"&lt;BR /&gt;wait ${T1}&lt;BR /&gt;wait #{T2}&lt;BR /&gt;echo "...finally..."&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jan 2008 17:53:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/wait-usage/m-p/4127367#M315768</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-01-10T17:53:38Z</dc:date>
    </item>
  </channel>
</rss>

