<?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: nohup script hanging on second  command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-script-hanging-on-second-command/m-p/2958835#M813764</link>
    <description>hi Clara,&lt;BR /&gt;&lt;BR /&gt;I might have been wrong about the shell not exiting part.. that i'd mentioned in my reply.&lt;BR /&gt;&lt;BR /&gt;the comand is run as specified user and then is logged out from.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x638038dfa974d711abdc0090277a778c,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x638038dfa974d711abdc0090277a778c,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I learnt this today.. sorry for the misinformation.&lt;BR /&gt;&lt;BR /&gt;- ramd.</description>
    <pubDate>Fri, 25 Apr 2003 09:35:11 GMT</pubDate>
    <dc:creator>Ramkumar Devanathan</dc:creator>
    <dc:date>2003-04-25T09:35:11Z</dc:date>
    <item>
      <title>nohup script hanging on second  command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-script-hanging-on-second-command/m-p/2958831#M813760</link>
      <description>Hi Experts!  I am by no means a scripting guru and would appreciate some help.  The script is suppose to su to a userid and issue a command to run in the background, then su to another userid and do it again.  For some reason it hangs when issuing the second su.  Here's the script, please help!!!&lt;BR /&gt;&lt;BR /&gt;root@whse370 #&amp;gt; cat START.DET_clara&lt;BR /&gt;:&lt;BR /&gt;&lt;BR /&gt;set -vx&lt;BR /&gt;killfile=/tmp/kill$$&lt;BR /&gt;&lt;BR /&gt;ps -ef |grep '.sh' &amp;gt; $killfile || exit 1&lt;BR /&gt;&lt;BR /&gt;#&lt;BR /&gt;if [ `grep archive_accusort_prdctn.sh "${killfile}" | wc -l ` -eq 0 ]&lt;BR /&gt;then  `su - spkop -c 'nohup /vol51/spkop/data_conversion/archive_accusort_prdctn.sh &amp;gt;&amp;gt; /vol51/apps/production/logs/spk_prdctn.log  2&amp;gt;&amp;amp;1 &amp;amp;'`&lt;BR /&gt;        echo "SPK PRODSTAT DATA LOAD HAS BEEN STARTED"&lt;BR /&gt;else    echo "SPK PRODSTAT DATA LOAD IS ALREADY RUNNING"&lt;BR /&gt;fi&lt;BR /&gt;#echo "next"&lt;BR /&gt;if [ `grep archive_gwl_accusort_prdctn.sh "${killfile}" | wc -l ` -eq 0 ]&lt;BR /&gt;then  `su - gwlop -c 'nohup /vol51/gwlop/data_conversion/archive_gwl_accusort_prdctn.sh &amp;gt;&amp;gt; /vol51/apps/production/logs/gwl_prdctn.log  2&amp;gt;&amp;amp;1 &amp;amp;'`&lt;BR /&gt;        echo "GWL PRODSTAT DATA LOAD HAS BEEN STARTED"&lt;BR /&gt;else    echo "GWL PRODSTAT DATA LOAD IS ALREADY RUNNING"&lt;BR /&gt;fi&lt;BR /&gt;echo "next"&lt;BR /&gt;if [ `grep ASI_gwl_accusort_prdctn. "${killfile}" | wc -l ` -eq 0 ]&lt;BR /&gt;then  `su - gwlop -c 'nohup /vol51/gwlop/data_conversion/ASI_gwl_accusort_prdctn.sh &amp;gt;&amp;gt; /vol51/apps/production/logs/ASI_prdctn.log  2&amp;gt;&amp;amp;1 &amp;amp;'`&lt;BR /&gt;        echo "GWL ASI PROD DATA LOAD HAS BEEN STARTED"&lt;BR /&gt;else    echo "GWL ASI PROD DATA LOAD IS ALREADY RUNNING"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;rm $killfile&lt;BR /&gt;&lt;BR /&gt;exit 0</description>
      <pubDate>Thu, 24 Apr 2003 16:31:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-script-hanging-on-second-command/m-p/2958831#M813760</guid>
      <dc:creator>Clara Rowe</dc:creator>
      <dc:date>2003-04-24T16:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: nohup script hanging on second  command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-script-hanging-on-second-command/m-p/2958832#M813761</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;you su command shouldn't contain a ' - ' after the su call.&lt;BR /&gt;&lt;BR /&gt;that logs in and creates a new shell for the particular user. as long as the shell runs, the next command will never be run.&lt;BR /&gt;&lt;BR /&gt;just run the su commands as below -&lt;BR /&gt;&lt;BR /&gt;su spkop -c 'nohup /vol51/spkop/data_conversion/archive_accusort_prdctn.sh &amp;gt;&amp;gt; /vol51/apps/production/logs/spk_prdctn.log 2&amp;gt;&amp;amp;1 &amp;amp;'`&lt;BR /&gt;&lt;BR /&gt;However, if you want the users environment settings to come into effect, before the command is run, then the above command would fail.&lt;BR /&gt;&lt;BR /&gt;HTH.&lt;BR /&gt;&lt;BR /&gt;- ramd.</description>
      <pubDate>Thu, 24 Apr 2003 16:40:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-script-hanging-on-second-command/m-p/2958832#M813761</guid>
      <dc:creator>Ramkumar Devanathan</dc:creator>
      <dc:date>2003-04-24T16:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: nohup script hanging on second  command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-script-hanging-on-second-command/m-p/2958833#M813762</link>
      <description>Excellent!!!!  Thank you so much that worked like a charm.</description>
      <pubDate>Thu, 24 Apr 2003 16:50:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-script-hanging-on-second-command/m-p/2958833#M813762</guid>
      <dc:creator>Clara Rowe</dc:creator>
      <dc:date>2003-04-24T16:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: nohup script hanging on second  command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-script-hanging-on-second-command/m-p/2958834#M813763</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm not sure that you need the backticks around the su command line.  You should be able to execute that command from your script without the backticks.  Since you aren't using the output of the su command line, it should work fine.&lt;BR /&gt;&lt;BR /&gt;Also, it looks like you are using the contents of the $killfile to see if each of the processes is running.  Another way to do that might be like this:&lt;BR /&gt;&lt;BR /&gt;if $(UNIX95=1 ps -fC archive_accusort_prdctn.sh &amp;gt;/dev/null);&lt;BR /&gt;then&lt;BR /&gt;  nohup ....&lt;BR /&gt;  echo "SPK HAS BEEN STARTED"&lt;BR /&gt;else&lt;BR /&gt;  echo "SPK IS ALREADY RUNNING"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Using the XPG4 part of ps [which is why the UNIX95=1 is used] makes it easier to look for a particular process.&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Apr 2003 16:54:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-script-hanging-on-second-command/m-p/2958834#M813763</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2003-04-24T16:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: nohup script hanging on second  command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-script-hanging-on-second-command/m-p/2958835#M813764</link>
      <description>hi Clara,&lt;BR /&gt;&lt;BR /&gt;I might have been wrong about the shell not exiting part.. that i'd mentioned in my reply.&lt;BR /&gt;&lt;BR /&gt;the comand is run as specified user and then is logged out from.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x638038dfa974d711abdc0090277a778c,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x638038dfa974d711abdc0090277a778c,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I learnt this today.. sorry for the misinformation.&lt;BR /&gt;&lt;BR /&gt;- ramd.</description>
      <pubDate>Fri, 25 Apr 2003 09:35:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-script-hanging-on-second-command/m-p/2958835#M813764</guid>
      <dc:creator>Ramkumar Devanathan</dc:creator>
      <dc:date>2003-04-25T09:35:11Z</dc:date>
    </item>
  </channel>
</rss>

