<?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 Question abt nohup in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-nohup/m-p/4407939#M682013</link>
    <description>Here is a snippet of the code - &lt;BR /&gt;&lt;BR /&gt;start)&lt;BR /&gt;&amp;gt;  if [ $running -eq 1 ] ; then&lt;BR /&gt;&amp;gt;  &amp;gt;  echo "JBoss already running (PID $pid)"&lt;BR /&gt;&amp;gt;  &amp;gt;  exit 1&lt;BR /&gt;&amp;gt;  fi&lt;BR /&gt;&amp;gt;  exec &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&amp;gt;  rm -f $PID_FILE&lt;BR /&gt;&amp;gt;  nohup $START_CMD $START_OPT &amp;amp;&lt;BR /&gt;&lt;BR /&gt;&lt;SNIP&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SNIP&gt;&lt;BR /&gt;&lt;BR /&gt;The application is crashing quite frequently and I suggested that we capture the output of nohup in a file instead of sending it to /dev/null. But here folks are suggesting that nohup.out should be existing on the system which I couldnt locate after an exhaustive find. My argument is that its already going to /dev/null but they are saying that the wrapper scripts output is going to /dev/null and the commands output is going to nohup.out.&lt;BR /&gt;&lt;BR /&gt;I have tried to look for nohup.out but couldnt find. Can u answer why?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan&lt;/SNIP&gt;&lt;/SNIP&gt;</description>
    <pubDate>Fri, 24 Apr 2009 19:43:03 GMT</pubDate>
    <dc:creator>Allanm</dc:creator>
    <dc:date>2009-04-24T19:43:03Z</dc:date>
    <item>
      <title>Question abt nohup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-nohup/m-p/4407939#M682013</link>
      <description>Here is a snippet of the code - &lt;BR /&gt;&lt;BR /&gt;start)&lt;BR /&gt;&amp;gt;  if [ $running -eq 1 ] ; then&lt;BR /&gt;&amp;gt;  &amp;gt;  echo "JBoss already running (PID $pid)"&lt;BR /&gt;&amp;gt;  &amp;gt;  exit 1&lt;BR /&gt;&amp;gt;  fi&lt;BR /&gt;&amp;gt;  exec &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&amp;gt;  rm -f $PID_FILE&lt;BR /&gt;&amp;gt;  nohup $START_CMD $START_OPT &amp;amp;&lt;BR /&gt;&lt;BR /&gt;&lt;SNIP&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SNIP&gt;&lt;BR /&gt;&lt;BR /&gt;The application is crashing quite frequently and I suggested that we capture the output of nohup in a file instead of sending it to /dev/null. But here folks are suggesting that nohup.out should be existing on the system which I couldnt locate after an exhaustive find. My argument is that its already going to /dev/null but they are saying that the wrapper scripts output is going to /dev/null and the commands output is going to nohup.out.&lt;BR /&gt;&lt;BR /&gt;I have tried to look for nohup.out but couldnt find. Can u answer why?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan&lt;/SNIP&gt;&lt;/SNIP&gt;</description>
      <pubDate>Fri, 24 Apr 2009 19:43:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-nohup/m-p/4407939#M682013</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-04-24T19:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Question abt nohup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-nohup/m-p/4407940#M682014</link>
      <description>&amp;gt;I have tried to look for nohup.out but couldn't find. Can you answer why?&lt;BR /&gt;&lt;BR /&gt;Because it is already redirected to /dev/null with that exec.  nohup(1) says:&lt;BR /&gt;If output is not redirected by the user, both standard output and standard error are sent to nohup.out.&lt;BR /&gt;nohup uses isatty(3) to check.</description>
      <pubDate>Fri, 24 Apr 2009 20:28:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-nohup/m-p/4407940#M682014</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-04-24T20:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Question abt nohup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-nohup/m-p/4407941#M682015</link>
      <description>Hi Allan:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; My argument is that its already going to /dev/null but they are saying that the wrapper scripts output is going to /dev/null and the commands output is going to nohup.out.&lt;BR /&gt;&lt;BR /&gt;No, the STDOUT and STDERR file descriptors have already been redirected to /dev/null by the 'exec'.  Everything written to STDOUT and/or STDERR from here on goes there unless you manipulate the file descriptors again.&lt;BR /&gt;&lt;BR /&gt;Consider this script:&lt;BR /&gt;&lt;BR /&gt;# cat ./mysh&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;START_CMD=date&lt;BR /&gt;START_OPT=-u&lt;BR /&gt;exec &amp;gt; /tmp/mylog1.$$ 2&amp;gt;&amp;amp;1&lt;BR /&gt;rm -f $PID_FILE&lt;BR /&gt;nohup $START_CMD $START_OPT &amp;amp;&lt;BR /&gt;1&amp;gt;&amp;amp;-&lt;BR /&gt;exec &amp;gt; /tmp/mylog2.$$&lt;BR /&gt;echo "ok from STDOUT"&lt;BR /&gt;print -u2 "ok from STDERR"&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./mysh&lt;BR /&gt;&lt;BR /&gt;# cat /tmp/mylog1*&lt;BR /&gt;cat /tmp/mylog1*&lt;BR /&gt;ok from STDERR&lt;BR /&gt;Fri Apr 24 22:18:59 UTC 2009&lt;BR /&gt;&lt;BR /&gt;# cat /tmp/mylog2*&lt;BR /&gt;ok from STDOUT&lt;BR /&gt;&lt;BR /&gt;The 'sh-posix' manpages will show you that '1&amp;gt;&amp;amp;-' closes file descriptor-1 (STDOUT) which is why we can then redirect it again.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 24 Apr 2009 21:24:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-nohup/m-p/4407941#M682015</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-04-24T21:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Question abt nohup</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-nohup/m-p/4407942#M682016</link>
      <description>&amp;gt;JRF: '1&amp;gt;&amp;amp;-' closes file descriptor-1 (STDOUT) which is why we can then redirect it again.&lt;BR /&gt;&lt;BR /&gt;Not "can" but probably "must", at least for stdin, stdout, stderr.  When you redirect, it closes the file first.&lt;BR /&gt;&lt;BR /&gt;So typically there isn't any need to do #&amp;gt;&amp;amp;-, unless you know you don't need it.</description>
      <pubDate>Sat, 25 Apr 2009 01:59:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-abt-nohup/m-p/4407942#M682016</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-04-25T01:59:59Z</dc:date>
    </item>
  </channel>
</rss>

