<?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: /sbin/init.d script problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889134#M402045</link>
    <description>Yes, the killproc() function is a handy way of matching process names (e.g. myproc) to PID's for kill scripts. You don't have to call the function but typically, you leave the function in the script but just don't call it.</description>
    <pubDate>Thu, 03 Mar 2005 12:14:10 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2005-03-03T12:14:10Z</dc:date>
    <item>
      <title>/sbin/init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889120#M402031</link>
      <description>I have created startup and shutdown scripts to manage oracle during a reboot or power failure.  The scripts do appear to work, however everything is not 100%.  It appears that the shutdown scripts are being executed twice.  Also, there is a bunch of "junk" being written to rc.log.  This is on a rp5470 running 11.11.&lt;BR /&gt;&lt;BR /&gt;The startup script is in /sbin/rc3.d, and the shutdown script is in /sbin/rc2.d.  Perhaps I'll attach the scripts and someone in the know can comment on it (this is all new to me).</description>
      <pubDate>Wed, 02 Mar 2005 23:00:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889120#M402031</guid>
      <dc:creator>CJENSEN_1</dc:creator>
      <dc:date>2005-03-02T23:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: /sbin/init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889121#M402032</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;scripts placed under /sbin/init.d and softlink to /sbin/rc2.d and rc3.d. and it works well.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Mar 2005 00:15:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889121#M402032</guid>
      <dc:creator>Ravi_8</dc:creator>
      <dc:date>2005-03-03T00:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: /sbin/init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889122#M402033</link>
      <description>Hi there&lt;BR /&gt;&lt;BR /&gt;Make sure that you ONLY have 2 links created as follows (substitue myscriptname for your script name!!):&lt;BR /&gt;&lt;BR /&gt;ln -s /sbin/init.d/myscriptname /sbin/rc2.d/K001myscriptname&lt;BR /&gt;ln -s /sbin/init.d/myscriptname /sbin/rc3.d/S999myscriptname&lt;BR /&gt;&lt;BR /&gt;When you do 'll -R /sbin | grep myscriptname' you should only have 3 entries.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;To prevent the 'junk' in the rc.log, you should remember to re-direct your output from each xxx_start_db line that you have in your script - for example:&lt;BR /&gt;&lt;BR /&gt;/u05/rpsb_admin/tiger_start_db &amp;gt;/tmp/logfile&lt;BR /&gt;or&lt;BR /&gt;/u05/rpsb_admin/tiger_start_db &amp;gt;/dev/null&lt;BR /&gt;&lt;BR /&gt;The latter is not preferable as you won't see any errors!!&lt;BR /&gt;&lt;BR /&gt;Hope that helps - Keith</description>
      <pubDate>Thu, 03 Mar 2005 02:56:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889122#M402033</guid>
      <dc:creator>Keith Bryson</dc:creator>
      <dc:date>2005-03-03T02:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: /sbin/init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889123#M402034</link>
      <description>In your scenario, if you must use two separate scripts for stop and start (you'd normally combine them into one and use a case statement to handle the passed start/stop rc argument) still create the links where the K001myscriptname points to your stop script (put it in /sbin/init.d) and S999myscriptname points to your start script (also put it in /sbin/init.d).&lt;BR /&gt;&lt;BR /&gt;Keith</description>
      <pubDate>Thu, 03 Mar 2005 03:01:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889123#M402034</guid>
      <dc:creator>Keith Bryson</dc:creator>
      <dc:date>2005-03-03T03:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: /sbin/init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889124#M402035</link>
      <description>To re-iterate:&lt;BR /&gt;&lt;BR /&gt;ln -s /sbin/init.d/mystopscript /sbin/rc2.d/K001myscriptname&lt;BR /&gt;ln -s /sbin/init.d/mystartscript /sbin/rc3.d/S999myscriptname&lt;BR /&gt;&lt;BR /&gt;When you do 'll -R /sbin | egrep "mystopscript|mystartscript"' you should only have 4 entries.&lt;BR /&gt;&lt;BR /&gt;Keith</description>
      <pubDate>Thu, 03 Mar 2005 03:04:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889124#M402035</guid>
      <dc:creator>Keith Bryson</dc:creator>
      <dc:date>2005-03-03T03:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: /sbin/init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889125#M402036</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;also have a look at the attached document which discusses about HP-UX system startup and configuration models.&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Thu, 03 Mar 2005 03:59:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889125#M402036</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2005-03-03T03:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: /sbin/init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889126#M402037</link>
      <description>attachment</description>
      <pubDate>Thu, 03 Mar 2005 04:03:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889126#M402037</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2005-03-03T04:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: /sbin/init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889127#M402038</link>
      <description>1) Yogeerah, the document you attached on startup and configuarion - it talks about 10.x.  Since this server is on 11.11, are there any changes?&lt;BR /&gt;2) I don't place anything under /etc/rc.config.c.  Granted, I am using two separate scripts - so I take it this is a non-issue?&lt;BR /&gt;3) I do not have any arguments to pass to the scripts, (hence no start_msg, start, stop_msg, or stop commands) - will this be an issue? &lt;BR /&gt;Thanks.</description>
      <pubDate>Thu, 03 Mar 2005 11:09:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889127#M402038</guid>
      <dc:creator>CJENSEN_1</dc:creator>
      <dc:date>2005-03-03T11:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: /sbin/init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889128#M402039</link>
      <description>One further question - with regards to the naming conventions for the link files.  The document mentions they should only be 10 characters long - myne exceed this.  Is this important?</description>
      <pubDate>Thu, 03 Mar 2005 11:27:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889128#M402039</guid>
      <dc:creator>CJENSEN_1</dc:creator>
      <dc:date>2005-03-03T11:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: /sbin/init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889129#M402040</link>
      <description>You are essentially breaking all the rules. There should be one script to do both the startup and shutdown. Your specific problem since you don't bother with those pesky arguments is that the script is being called twice -- once with 'stop_msg' and again with 'stop'. Since your code doesn't branch, it executes twice. The same rules apply as in 10.20; play by the rules and you should be fine.&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Mar 2005 11:31:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889129#M402040</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-03-03T11:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: /sbin/init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889130#M402041</link>
      <description>Its not you that passes the arguments to the script, its the operating system.&lt;BR /&gt;&lt;BR /&gt;The operating system will call the script twice on startup, once passing it the argument 'start_msg', the second time passing the argument 'start'. The first call is to allow the script to output a short line that will be displayed on the console (usually between [ ]'s), the second call is to actual start whatever the script is going to start.&lt;BR /&gt;&lt;BR /&gt;The operating system will call the script twice on system shutdown, once passing it the argument 'stop_msg', the second time passing it the argument 'stop', for similar reasons.&lt;BR /&gt;&lt;BR /&gt;Thus you should have a control script in /sbin/init.d which does something like ...&lt;BR /&gt;&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt;&lt;BR /&gt;# comments&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;PATH=... whatever ...&lt;BR /&gt;export PATH&lt;BR /&gt;&lt;BR /&gt;case "$1" in&lt;BR /&gt;&lt;BR /&gt;    "start_msg") echo "Starting XYZ" ;;&lt;BR /&gt;&lt;BR /&gt;    "start") start_script ;;&lt;BR /&gt;&lt;BR /&gt;    "stop_msg") echo "Stopping XYZ" ;;&lt;BR /&gt;&lt;BR /&gt;    "stop") stop_script ;;&lt;BR /&gt;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;exit 0;&lt;BR /&gt;&lt;BR /&gt;############&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You start_script/stop_scripts can be wherever you like, provided you set the path correctly in the control script. You need to create a Kxxxx link in /sbin/rc2.d and a Sxxx link in /sbin/rc3.d to the control file.&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Mar 2005 11:36:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889130#M402041</guid>
      <dc:creator>Stephen Keane</dc:creator>
      <dc:date>2005-03-03T11:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: /sbin/init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889131#M402042</link>
      <description>Thanks.  Stephen Keane - can I just clarify your comments please - I take it that I just need one script in /sbin/init.d, and it gets called from rc2.d/rc3.d for stop/start respectively.  Is this correct?  Do I need anything in the /etc/rc.config.d directory?</description>
      <pubDate>Thu, 03 Mar 2005 11:42:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889131#M402042</guid>
      <dc:creator>CJENSEN_1</dc:creator>
      <dc:date>2005-03-03T11:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: /sbin/init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889132#M402043</link>
      <description>You don't have to have anything in /etc/rc.config.d; that is an HP-UX convention and provides an easy way to set environment variables and most typically to put a flag variable set to 1 or 0 to run or not to run the related rc script. The 'by the rules' method is to have a file in /etc/rc.config.d of the same name as the script in /sbin/init.d and the init.d script sources the /etc/rc.config.d file via the "." (dot) operator.&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Mar 2005 11:47:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889132#M402043</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-03-03T11:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: /sbin/init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889133#M402044</link>
      <description>With regards to the /sbin/init.d/template file:&lt;BR /&gt;I'm using this file to re-build my scripts.  Since my script only starts and stops Oracle services - the section in that template file that is "Kill the named Process(es), $1=&lt;SEARCH pattern="" for="" your="" process=""&gt;" - I don't understand how this section applies to my start/stop scripts.  Can I ignore this section?&lt;/SEARCH&gt;</description>
      <pubDate>Thu, 03 Mar 2005 12:07:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889133#M402044</guid>
      <dc:creator>CJENSEN_1</dc:creator>
      <dc:date>2005-03-03T12:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: /sbin/init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889134#M402045</link>
      <description>Yes, the killproc() function is a handy way of matching process names (e.g. myproc) to PID's for kill scripts. You don't have to call the function but typically, you leave the function in the script but just don't call it.</description>
      <pubDate>Thu, 03 Mar 2005 12:14:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889134#M402045</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-03-03T12:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: /sbin/init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889135#M402046</link>
      <description>Thanks everyone for your responses - it is much appreciated.  Everything is 100% now.  I have assigned points to this thread.</description>
      <pubDate>Fri, 04 Mar 2005 09:49:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889135#M402046</guid>
      <dc:creator>CJENSEN_1</dc:creator>
      <dc:date>2005-03-04T09:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: /sbin/init.d script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889136#M402047</link>
      <description>Thanks</description>
      <pubDate>Mon, 07 Mar 2005 14:54:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sbin-init-d-script-problem/m-p/4889136#M402047</guid>
      <dc:creator>CJENSEN_1</dc:creator>
      <dc:date>2005-03-07T14:54:59Z</dc:date>
    </item>
  </channel>
</rss>

