<?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: Auto Start script question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/auto-start-script-question/m-p/3150234#M157403</link>
    <description>The output from a start/stop script is logged into /etc/rc.log and should only contain success/failure info. Apparently, the Tvoli commands you are using are dumping these logs to stdout. If you run the Tivoli startup commands, do you see backup log?</description>
    <pubDate>Sun, 21 Dec 2003 15:27:53 GMT</pubDate>
    <dc:creator>Bill Hassell</dc:creator>
    <dc:date>2003-12-21T15:27:53Z</dc:date>
    <item>
      <title>Auto Start script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/auto-start-script-question/m-p/3150231#M157400</link>
      <description>Hi, &lt;BR /&gt;I grabbed one of the auto start scripts from /sbin/init.d and altered it to start Tivoli upon reboot for me.  My problem is that when it starts, it writes the backup log to the /etc/rc.log which I do not want.  It also logs in the proper placedsmsched.log), I don't need the logging in the rc.log.  &lt;BR /&gt;Thanks in advance for any help.</description>
      <pubDate>Sat, 20 Dec 2003 23:09:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/auto-start-script-question/m-p/3150231#M157400</guid>
      <dc:creator>John Sutton</dc:creator>
      <dc:date>2003-12-20T23:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Start script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/auto-start-script-question/m-p/3150232#M157401</link>
      <description>If you upload the start script, it would be a big help.</description>
      <pubDate>Sun, 21 Dec 2003 00:17:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/auto-start-script-question/m-p/3150232#M157401</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2003-12-21T00:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Start script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/auto-start-script-question/m-p/3150233#M157402</link>
      <description>Most hp depots come with their own start scritps.&lt;BR /&gt;&lt;BR /&gt;For products that don't you may wish to start with a copy of template in /sbin/init.d&lt;BR /&gt;&lt;BR /&gt;Its a good starting point.&lt;BR /&gt;&lt;BR /&gt;Please upload the script.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Sun, 21 Dec 2003 01:32:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/auto-start-script-question/m-p/3150233#M157402</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-12-21T01:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Start script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/auto-start-script-question/m-p/3150234#M157403</link>
      <description>The output from a start/stop script is logged into /etc/rc.log and should only contain success/failure info. Apparently, the Tvoli commands you are using are dumping these logs to stdout. If you run the Tivoli startup commands, do you see backup log?</description>
      <pubDate>Sun, 21 Dec 2003 15:27:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/auto-start-script-question/m-p/3150234#M157403</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-12-21T15:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Start script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/auto-start-script-question/m-p/3150235#M157404</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you might want to reroute the output of the start script of tivoli to some place else.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Sun, 21 Dec 2003 18:37:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/auto-start-script-question/m-p/3150235#M157404</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-21T18:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Start script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/auto-start-script-question/m-p/3150236#M157405</link>
      <description>I am posting the script, Hope it shows up legible.  Thank you for the help.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;PATH=/sbin:/usr/sbin:/usr/bin:/opt/tivoli/tsm/client/ba/bin    &lt;BR /&gt;export PATH                                             &lt;BR /&gt;rval=0                                                         &lt;BR /&gt;set_return() {                                                   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;case $1 in                                                     &lt;BR /&gt;start_msg)                                                     &lt;BR /&gt;        echo "Start Tivoli server daemon"                      &lt;BR /&gt;        ;;                                        &lt;BR /&gt;stop_msg)                                                      &lt;BR /&gt;        echo "Stopping Tivoli server daemon"                   &lt;BR /&gt;        ;;                                                               &lt;BR /&gt;'start')                                                                       &lt;BR /&gt; if [ -f /opt/tivoli/tsm/client/ba/bin/dsmc ] ; then                    &lt;BR /&gt;                cd /tiv                                     nohup /opt/tivoli/tsm/client/ba/bin/dsmc schedule &amp;amp;            &lt;BR /&gt;        else                                                                   &lt;BR /&gt;                echo "ERROR: /opt/tivoli/tsm/client/ba/bin/dsmc file MISSING"  &lt;BR /&gt;        fi                                                                     &lt;BR /&gt;                rval=2                                                                    &lt;BR /&gt;        ;;                                                               &lt;BR /&gt;'stop')                                     #                                                                      &lt;BR /&gt; # Determine PID of process(es) to stop                                 &lt;BR /&gt;        #                                                                      &lt;BR /&gt;        pid=`ps -ef|grep dsmc|grep -v grep |awk '{print $2}'`                  &lt;BR /&gt;        if [ "X$pid" != "X" ]; then                                            &lt;BR /&gt;                if kill $pid; then                                             &lt;BR /&gt;                        echo "Tivoli daemon stopped"                           &lt;BR /&gt;                else                                                           &lt;BR /&gt;                        set_return                                             &lt;BR /&gt;                        echo "Unable to stop Tivoli daemon&lt;BR /&gt;                fi                                        &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>Sun, 21 Dec 2003 22:33:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/auto-start-script-question/m-p/3150236#M157405</guid>
      <dc:creator>John Sutton</dc:creator>
      <dc:date>2003-12-21T22:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Start script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/auto-start-script-question/m-p/3150237#M157406</link>
      <description>Looks like a standard start script. I have legato and start it on boot up. Never noticed anything in my rc.log. &lt;BR /&gt;&lt;BR /&gt;What happens if you run the script&lt;BR /&gt;&lt;BR /&gt;/sbin/init.d/script start&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This is the networker file that legato installed &lt;BR /&gt;&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt;# installed by postinstall on Wed Nov 19 16:59:06 EST 2003&lt;BR /&gt;#&lt;BR /&gt;# Default locale&lt;BR /&gt;#&lt;BR /&gt;LANG=C&lt;BR /&gt;export LANG&lt;BR /&gt;&lt;BR /&gt;# Override to a different locale if /usr/lib/nsr/LANG exist&lt;BR /&gt;[ -r /usr/lib/nsr/LANG ] &amp;amp;&amp;amp; . /usr/lib/nsr/LANG&lt;BR /&gt;&lt;BR /&gt;case $1 in&lt;BR /&gt;'start_msg')&lt;BR /&gt;        echo 'Starting Networker daemons'&lt;BR /&gt;        ;;&lt;BR /&gt;'stop_msg')&lt;BR /&gt;        echo 'Stopping Networker daemons'&lt;BR /&gt;        ;;&lt;BR /&gt;'start')&lt;BR /&gt;(echo 'starting NetWorker daemons:') &amp;gt;&amp;gt; /etc/rc.log&lt;BR /&gt;if [ -f /opt/networker/bin/nsrexecd ]; then&lt;BR /&gt;        (/opt/networker/bin/nsrexecd) &amp;gt;&amp;gt; /etc/rc.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;        (echo ' nsrexecd') &amp;gt;&amp;gt; /etc/rc.log&lt;BR /&gt;fi&lt;BR /&gt;if [ -f /opt/networker/bin/lgtolmd ]; then&lt;BR /&gt;        (/opt/networker/bin/lgtolmd -p /nsr/lic -n 1) &amp;gt;&amp;gt; /etc/rc.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;        (echo ' lgtolmd') &amp;gt;&amp;gt; /etc/rc.log&lt;BR /&gt;fi&lt;BR /&gt;if [ -f /opt/networker/bin/nsrd -a ! -f /opt/networker/bin/NetWorker.clustersvr&lt;BR /&gt;]; then&lt;BR /&gt;        (/opt/networker/bin/nsrd) &amp;gt;&amp;gt; /etc/rc.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;        (echo ' nsrd') &amp;gt;&amp;gt; /etc/rc.log&lt;BR /&gt;fi&lt;BR /&gt;        ;;&lt;BR /&gt;'stop')&lt;BR /&gt;(echo 'stopping NetWorker daemons:') &amp;gt;&amp;gt; /etc/rc.log&lt;BR /&gt;if [ -f /opt/networker/bin/nsr_shutdown ]; then&lt;BR /&gt;        if [ -f /opt/networker/bin/NetWorker.clustersvr ]; then&lt;BR /&gt;                (/opt/networker/bin/nsr_shutdown -c -a -q&amp;amp;) &amp;gt;&amp;gt; /etc/rc.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;                (echo ' nsr_shutdown -c -a -q') &amp;gt;&amp;gt; /etc/rc.log&lt;BR /&gt;        else&lt;BR /&gt;                (/opt/networker/bin/nsr_shutdown -a -q&amp;amp;) &amp;gt;&amp;gt; /etc/rc.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;                (echo ' nsr_shutdown -a -q') &amp;gt;&amp;gt; /etc/rc.log&lt;BR /&gt;        fi&lt;BR /&gt;fi&lt;BR /&gt;        ;;&lt;BR /&gt;*)&lt;BR /&gt;echo "usage: `basename $0` {start|stop}"&lt;BR /&gt;        ;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;I only get the start and stop messages. Networker sends its annoying crap to the console.&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Dec 2003 08:43:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/auto-start-script-question/m-p/3150237#M157406</guid>
      <dc:creator>R. Allan Hicks</dc:creator>
      <dc:date>2003-12-22T08:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Start script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/auto-start-script-question/m-p/3150238#M157407</link>
      <description>A couple of notes:&lt;BR /&gt; &lt;BR /&gt;The logging code is being produced by the command:&lt;BR /&gt; &lt;BR /&gt;/opt/tivoli/tsm/client/ba/bin/dsmc schedule &lt;BR /&gt; &lt;BR /&gt;If you run this from a shell prompt and it does not produce a log listing, then the environment is triggering the log dump. You'll need to explicitly create the same environment during start-up since start-up doe NOT login and run any profiles. To see how different the login environment is from the start-up environment, save the output of the env command from a login prompt and add env to your start script. Just add the missing items to your start script.&lt;BR /&gt; &lt;BR /&gt;As far as starting and stopping, here are a couple of suggestions:&lt;BR /&gt; &lt;BR /&gt;1. Rather than check the executable as a file (-f option), use the -x instead. This verifies that the executable exists and is also executable.&lt;BR /&gt; &lt;BR /&gt;2. Searching for a process using grep can produce very ambiguous results since grep does not look at the process name--it looks at everything on the line including user names and command line arguments. Elimnate the ambiguiy by letting ps search for you (it's much faster). Change the lines:&lt;BR /&gt; &lt;BR /&gt;pid=`ps -ef|grep dsmc|grep -v grep |awk '{print $2}'` &lt;BR /&gt;if [ "X$pid" != "X" ]; then &lt;BR /&gt;if kill $pid; then &lt;BR /&gt;echo "Tivoli daemon stopped" &lt;BR /&gt;else &lt;BR /&gt;set_return &lt;BR /&gt;echo "Unable to stop Tivoli daemon&lt;BR /&gt; &lt;BR /&gt;to:&lt;BR /&gt; &lt;BR /&gt;PID=$(UNIX95= ps -C dsmc -o pid | tail -1)&lt;BR /&gt;if [ $PID = PID ]&lt;BR /&gt;then&lt;BR /&gt; echo "Tivoli dsmc not running"&lt;BR /&gt;else&lt;BR /&gt; if kill $PID&lt;BR /&gt; then&lt;BR /&gt; echo "Tivoli daemon stopped"&lt;BR /&gt; fi&lt;BR /&gt;fi&lt;BR /&gt; &lt;BR /&gt;The construct "UNIX=95 ps" activates a large number of additional parameters for ps including -C -H and -o. -o is particularly useful as you can specify exactly what you want from ps. If the process is not found, just the text "PID" is returned, otherwise, the PID for the last occurance of dsmc will be returned. In the above code, you can test it using everything inside the parens $() (which is strongly preferred over backtics or grave accent (see man page for sh-posix or ksh). For instance, these two constructs produce very different results:&lt;BR /&gt; &lt;BR /&gt;ps -ef | grep sh | grep -v grep&lt;BR /&gt; &lt;BR /&gt;UNIX95= ps -fC sh&lt;BR /&gt; &lt;BR /&gt;The second form is accurate because ps looks at the process table by name, not by grep'ing a bunch of unrelated fields.</description>
      <pubDate>Mon, 22 Dec 2003 09:28:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/auto-start-script-question/m-p/3150238#M157407</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-12-22T09:28:25Z</dc:date>
    </item>
  </channel>
</rss>

