<?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 Startup Script to automatically start TSM deamon in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/startup-script-to-automatically-start-tsm-deamon/m-p/4762562#M610355</link>
    <description>Hi All, can anyone provide me a script to automatically recycle the TSM Client dsmc scheduler deamon?</description>
    <pubDate>Tue, 08 Mar 2011 08:06:35 GMT</pubDate>
    <dc:creator>Ahmed BH</dc:creator>
    <dc:date>2011-03-08T08:06:35Z</dc:date>
    <item>
      <title>Startup Script to automatically start TSM deamon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/startup-script-to-automatically-start-tsm-deamon/m-p/4762562#M610355</link>
      <description>Hi All, can anyone provide me a script to automatically recycle the TSM Client dsmc scheduler deamon?</description>
      <pubDate>Tue, 08 Mar 2011 08:06:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/startup-script-to-automatically-start-tsm-deamon/m-p/4762562#M610355</guid>
      <dc:creator>Ahmed BH</dc:creator>
      <dc:date>2011-03-08T08:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Startup Script to automatically start TSM deamon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/startup-script-to-automatically-start-tsm-deamon/m-p/4762563#M610356</link>
      <description>Do you have problems with the daemon where it crashes or stops running? The brute force way to fix this is to put the program's startup command in /etc/inittab and then specifying :respawn: as the action.</description>
      <pubDate>Wed, 09 Mar 2011 01:19:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/startup-script-to-automatically-start-tsm-deamon/m-p/4762563#M610356</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2011-03-09T01:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Startup Script to automatically start TSM deamon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/startup-script-to-automatically-start-tsm-deamon/m-p/4762564#M610357</link>
      <description>I have the below script:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;cd /&lt;BR /&gt;/sbin/init.d/tsm_client &amp;amp;&lt;BR /&gt;ssh servername /sbin/init.d/tsm_client &amp;amp;&lt;BR /&gt;&lt;BR /&gt;sleep 5&lt;BR /&gt;&lt;BR /&gt;echo ===============================&lt;BR /&gt;echo servername2&lt;BR /&gt;ps -ef|grep dsm&lt;BR /&gt;&lt;BR /&gt;echo ===============================&lt;BR /&gt;echo servername&lt;BR /&gt;ssh servername ps -ef|grep dsm&lt;BR /&gt;&lt;BR /&gt;How can I run these commands as HP-UX boots?</description>
      <pubDate>Thu, 10 Mar 2011 11:05:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/startup-script-to-automatically-start-tsm-deamon/m-p/4762564#M610357</guid>
      <dc:creator>Ahmed BH</dc:creator>
      <dc:date>2011-03-10T11:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Startup Script to automatically start TSM deamon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/startup-script-to-automatically-start-tsm-deamon/m-p/4762565#M610358</link>
      <description>&lt;!--!*#--&gt;This appears to be a start sequence for Tivoli and it appears that tsm_client is already in the correct location (/sbin/init.d). If the tsm_client script was written correctly, there is no reason to run the script in the background (it will always complete and should leave processes running). To see what the tsm_client did during bootup, look at /etc/rc.log.&lt;BR /&gt; &lt;BR /&gt;The correct way to start tsm_client is to place a symbolic link in the /sbin/rc3.d directory, one starting with "S###" and the second link starting with "K###". The alphabetical listing of the links in rc3.d shows the order in which the S(start) scripts will run on bootup and the K(kill) scripts will run at shutdown.&lt;BR /&gt; &lt;BR /&gt;The next line in your script indicates that the same script is to be run on a remote server. This seems a bit strange since I assume you have the tsm_client run during bootup on the remote machine too. Just add the symbolic links to the remote system and check the remote machine's /etc/rc.log for status. This is the normal way to start and stop applications at bootup and shutdown.&lt;BR /&gt; &lt;BR /&gt;If you need to verify that a process is running, use the exact match capability of ps:&lt;BR /&gt; &lt;BR /&gt;UNIX95=1 ps -fC dsm&lt;BR /&gt; &lt;BR /&gt;Type the command line exactly as shown -- UNIX95=1 temporarily sets a flag for ps to use additional options. -C dsm will only find dsm and not dsm1123 or abcdsm (which is the mistake grep will make). The same is true for both local and remote commands. &lt;BR /&gt; &lt;BR /&gt;So it appears that your script is required because tsm_cient is not always starting and nobody is being notified when it doesn't work. I would write a boot check script something like this:&lt;BR /&gt; &lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;set -u&lt;BR /&gt;export PATH=/usr/bin&lt;BR /&gt;&lt;BR /&gt;case $1 in&lt;BR /&gt; 'start_msg')&lt;BR /&gt;     echo "Checking tsm_client"&lt;BR /&gt;     exit 0&lt;BR /&gt;     ;;&lt;BR /&gt; &lt;BR /&gt; 'start')&lt;BR /&gt;   CMD='UNIX95=1 ps -C dsm &amp;gt; /dev/null 2&amp;gt;&amp;amp;1'&lt;BR /&gt;# Check Tivoli locally&lt;BR /&gt;   eval "$CMD"&lt;BR /&gt;   RTN1=$?&lt;BR /&gt;   if [ $RTN1 -ne 0 ]&lt;BR /&gt;   then&lt;BR /&gt;       echo "Check /etc/rc.log" | &lt;BR /&gt;       mailx -s "tsm_client not running" &lt;BR /&gt;sysadmin@mycompany.com &lt;BR /&gt;   fi&lt;BR /&gt;# Check tsm_client remotely&lt;BR /&gt;   SERVER=servername2&lt;BR /&gt;   ssh -n $SERVER "$CMD"&lt;BR /&gt;   RTN2=$?&lt;BR /&gt;   if [ $RTN2 -ne 0 ]&lt;BR /&gt;   then&lt;BR /&gt;       echo "Check /etc/rc.log on $SERVER" | &lt;BR /&gt;       mailx -s "tsm_client not running at $SERVER" &lt;BR /&gt;sysadmin@mycompany.com &lt;BR /&gt;   fi&lt;BR /&gt;   if [ $ RTN1 -ne 0 ]] &amp;amp;&amp;amp; exit 1&lt;BR /&gt;   if [ $ RTN2 -ne 0 ]] &amp;amp;&amp;amp; exit 1&lt;BR /&gt;   exit 0&lt;BR /&gt;   ;;&lt;BR /&gt;esac&lt;BR /&gt; &lt;BR /&gt;The 2 conditions in the case statement are required for all start/stop scripts. The ps command is given the UNIX95 variable to enable the -C option, but we don't need any details like -f. Instead, ps returns 0 if one or more processes with that name are found, or 1 if the process is not found. ssh -n is used when running non-interactive commands.&lt;BR /&gt; &lt;BR /&gt;Place this script in /sbin/init.d with a name like tsm_check. Then make a link in /sbin/rc3.d something like:&lt;BR /&gt; &lt;BR /&gt;ln -s /sbin/init.d/tsm_check /sbin/rc3.d/S999tsm_check</description>
      <pubDate>Thu, 10 Mar 2011 12:54:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/startup-script-to-automatically-start-tsm-deamon/m-p/4762565#M610358</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2011-03-10T12:54:56Z</dc:date>
    </item>
  </channel>
</rss>

