<?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: init.d script problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/init-d-script-problem/m-p/3052101#M136752</link>
    <description>Tom,&lt;BR /&gt;&lt;BR /&gt;When you say you run it from the command line, do you mean you run '/sbin/init.d/tomcat start' or 'nohup nice $CATALINA_HOME/bin/startup.sh' ?&lt;BR /&gt;&lt;BR /&gt;Running the init script as root can make in difference in troubleshooting.&lt;BR /&gt;&lt;BR /&gt;If you are already doing that, try introducing some logging into the Tomcat applcation, perhaps modifying the startup.sh for some 'echo "half-way_done"' kind of things. Perhaps another shell script that startup.sh calls...&lt;BR /&gt;&lt;BR /&gt;If you start it manually and it works, does the init stop script work ?&lt;BR /&gt;&lt;BR /&gt;Hope these suggestions help!</description>
    <pubDate>Tue, 19 Aug 2003 17:26:14 GMT</pubDate>
    <dc:creator>Robert Gamble</dc:creator>
    <dc:date>2003-08-19T17:26:14Z</dc:date>
    <item>
      <title>init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/init-d-script-problem/m-p/3052100#M136751</link>
      <description>I'm having an oddity with an /sbin/init.d startup script for Tomcat 4.0.3 on an HP-UX 11.0 system.  I can run the script from the command line, and it works fine.  But at system reboot, it gets run, returns with an OK, and the tomcat gets far enough along to write a little bit of initialization information to its logs, but then the process disappears without any error.  Note in the listing below that I am using nohup and a sleep to start Tomcat.&lt;BR /&gt;&lt;BR /&gt;Ideas?&lt;BR /&gt;&lt;BR /&gt;-Tom&lt;BR /&gt;&lt;BR /&gt;-------------------------------&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt;&lt;BR /&gt;CATALINA_HOME=/opt/tomcat&lt;BR /&gt;JAVA_HOME=/opt/java&lt;BR /&gt;export CATALINA_HOME&lt;BR /&gt;export JAVA_HOME&lt;BR /&gt;&lt;BR /&gt;PATH=/sbin:/usr/sbin:/usr/bin&lt;BR /&gt;export PATH&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;rval=0&lt;BR /&gt;set_return() {&lt;BR /&gt; x=$?&lt;BR /&gt; if [ $x -ne 0 ]; then&lt;BR /&gt;  echo "ERROR CODE $x"&lt;BR /&gt;  rval=1&lt;BR /&gt; fi&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;case $1 in&lt;BR /&gt;start_msg)&lt;BR /&gt; echo "Start Tomcat"&lt;BR /&gt; ;;&lt;BR /&gt;&lt;BR /&gt;stop_msg)&lt;BR /&gt; echo "Stopping Tomcat"&lt;BR /&gt; ;;&lt;BR /&gt;&lt;BR /&gt;'start')&lt;BR /&gt; if [ -x $CATALINA_HOME/bin/startup.sh ] ; then&lt;BR /&gt;  nohup nice $CATALINA_HOME/bin/startup.sh &amp;gt; /tmp/tomcat.out 2&amp;gt;&amp;amp;1 &amp;amp;&lt;BR /&gt;  sleep 10&lt;BR /&gt;  set_return&lt;BR /&gt; else&lt;BR /&gt;  rval=2&lt;BR /&gt; fi&lt;BR /&gt; ;;&lt;BR /&gt;&lt;BR /&gt;'stop')&lt;BR /&gt; if [ -x $CATALINA_HOME/bin/shutdown.sh ] ; then&lt;BR /&gt;  $CATALINA_HOME/bin/shutdown.sh &amp;amp;&lt;BR /&gt;  set_return&lt;BR /&gt; else&lt;BR /&gt;  rval=2&lt;BR /&gt; fi&lt;BR /&gt; ;;&lt;BR /&gt;&lt;BR /&gt;*)&lt;BR /&gt; echo "usage: $0 {start|stop}"&lt;BR /&gt; ;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;exit $rval&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Aug 2003 17:06:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/init-d-script-problem/m-p/3052100#M136751</guid>
      <dc:creator>T Dockery</dc:creator>
      <dc:date>2003-08-19T17:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/init-d-script-problem/m-p/3052101#M136752</link>
      <description>Tom,&lt;BR /&gt;&lt;BR /&gt;When you say you run it from the command line, do you mean you run '/sbin/init.d/tomcat start' or 'nohup nice $CATALINA_HOME/bin/startup.sh' ?&lt;BR /&gt;&lt;BR /&gt;Running the init script as root can make in difference in troubleshooting.&lt;BR /&gt;&lt;BR /&gt;If you are already doing that, try introducing some logging into the Tomcat applcation, perhaps modifying the startup.sh for some 'echo "half-way_done"' kind of things. Perhaps another shell script that startup.sh calls...&lt;BR /&gt;&lt;BR /&gt;If you start it manually and it works, does the init stop script work ?&lt;BR /&gt;&lt;BR /&gt;Hope these suggestions help!</description>
      <pubDate>Tue, 19 Aug 2003 17:26:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/init-d-script-problem/m-p/3052101#M136752</guid>
      <dc:creator>Robert Gamble</dc:creator>
      <dc:date>2003-08-19T17:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/init-d-script-problem/m-p/3052102#M136753</link>
      <description>Robert,&lt;BR /&gt;&lt;BR /&gt;I mean I run /sbin/init.d/tomcat start as root, and it works correctly.  And yes, /sbin/init.d/tomcat stop works as expected.&lt;BR /&gt;&lt;BR /&gt;The Tomcat startup gets as far as launching the Java process, so adding more "got heres" in the script isn't likely to give me anything more.  The log output from the Tomcat java process varies; if I extend the sleep from 10 seconds to 120 seconds, I get a bit more, but all normal processing, no hint of a reason for failure.&lt;BR /&gt;&lt;BR /&gt;It appears that the process is getting a SIGHUP or SIGTERM, but nohup should prevent that.  Somehow this appears to me to be the nub of the problem.&lt;BR /&gt;&lt;BR /&gt;FYI, this is Tomcat 4.0.3 directly from the Apache Jakarta site, as we need a common install for HP-UX, Solaris and Windows.  The startup.sh script execs catalina.sh, which invokes java with Tomcat's org.apache.catalina.startup.Bootstrap class.&lt;BR /&gt;&lt;BR /&gt;-Tom</description>
      <pubDate>Tue, 19 Aug 2003 18:02:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/init-d-script-problem/m-p/3052102#M136753</guid>
      <dc:creator>T Dockery</dc:creator>
      <dc:date>2003-08-19T18:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/init-d-script-problem/m-p/3052103#M136754</link>
      <description>Do you really need the nohup ? The startup.sh should complete in a reasonable time. I know it shouldn't have anything to do with it, but at this point, it is worth a try.&lt;BR /&gt;&lt;BR /&gt;Since you point out the script runs comepletly, but the resulting processes do not live long, it seems to point to some type of environment entity is killing it, which could be a parent process dying and bring (somehow) down the nohup'd &amp;amp; backgrounded processes.&lt;BR /&gt;&lt;BR /&gt;Play with removing the nohup and '&amp;amp;'.&lt;BR /&gt;&lt;BR /&gt;Hopefully someone with better scripting experience will read this and point out what we are forgetting to consider.  ;)</description>
      <pubDate>Tue, 19 Aug 2003 18:23:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/init-d-script-problem/m-p/3052103#M136754</guid>
      <dc:creator>Robert Gamble</dc:creator>
      <dc:date>2003-08-19T18:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/init-d-script-problem/m-p/3052104#M136755</link>
      <description>Thanks for the idea, but same result without the nohup.  Which reminds me, this script has been working for several months on a pair of old E55 systems, after I added the nohup and the sleep.  It is now failing on L-class machines.  Both types of systems are running HP-UX 11.0.  The obvious differences are 32-bit vs 64-bit installations, and much faster processors.</description>
      <pubDate>Tue, 19 Aug 2003 19:11:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/init-d-script-problem/m-p/3052104#M136755</guid>
      <dc:creator>T Dockery</dc:creator>
      <dc:date>2003-08-19T19:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/init-d-script-problem/m-p/3052105#M136756</link>
      <description>Is the enviornment set properly for tomcat to start at startup. When you run it as root the environment is set and it works.</description>
      <pubDate>Tue, 19 Aug 2003 19:52:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/init-d-script-problem/m-p/3052105#M136756</guid>
      <dc:creator>GK_5</dc:creator>
      <dc:date>2003-08-19T19:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/init-d-script-problem/m-p/3052106#M136757</link>
      <description>Yes, the environment is correct.  From the script:&lt;BR /&gt;&lt;BR /&gt;CATALINA_HOME=/opt/tomcat&lt;BR /&gt;JAVA_HOME=/opt/java&lt;BR /&gt;export CATALINA_HOME&lt;BR /&gt;export JAVA_HOME&lt;BR /&gt;&lt;BR /&gt;PATH=/sbin:/usr/sbin:/usr/bin&lt;BR /&gt;export PATH &lt;BR /&gt;&lt;BR /&gt;The startup.sh script takes care of anything else.</description>
      <pubDate>Wed, 20 Aug 2003 12:27:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/init-d-script-problem/m-p/3052106#M136757</guid>
      <dc:creator>T Dockery</dc:creator>
      <dc:date>2003-08-20T12:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/init-d-script-problem/m-p/3052107#M136758</link>
      <description>Interestingly, I tried replacing the startup line that begins with nohup with the following:&lt;BR /&gt;&lt;BR /&gt;at now &amp;lt;&amp;lt; EOD &amp;gt; /tmp/tomcat.out 2&amp;gt;&amp;amp;1&lt;BR /&gt;nice $CATALINA_HOME/bin/startup.sh &amp;gt;&amp;gt; /tmp/tomcat.out 2&amp;gt;&amp;amp;1 &amp;amp;&lt;BR /&gt;EOD&lt;BR /&gt;&lt;BR /&gt;Works like a charm.  But why does "at" work when "nohup" doesn't?&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Aug 2003 19:16:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/init-d-script-problem/m-p/3052107#M136758</guid>
      <dc:creator>T Dockery</dc:creator>
      <dc:date>2003-08-20T19:16:20Z</dc:date>
    </item>
  </channel>
</rss>

