<?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: Script at boot up. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811953#M268469</link>
    <description>&lt;A href="http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1302619965694." target="_blank"&gt;http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1302619965694.&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Awadhesh</description>
    <pubDate>Mon, 26 Jun 2006 23:36:28 GMT</pubDate>
    <dc:creator>AwadheshPandey</dc:creator>
    <dc:date>2006-06-26T23:36:28Z</dc:date>
    <item>
      <title>Script at boot up.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811943#M268459</link>
      <description>I have a couple of scripts I need to put in place. &lt;BR /&gt;&lt;BR /&gt;I would like to execute them when the system comes up and shuts down. Tese are to bring the databeses and shut them down.&lt;BR /&gt;&lt;BR /&gt;Can someone help me set them up. &lt;BR /&gt;&lt;BR /&gt;Where would it be the best place to put them and how.&lt;BR /&gt;&lt;BR /&gt;Thanks...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 25 Jun 2006 13:04:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811943#M268459</guid>
      <dc:creator>Rafael Casero</dc:creator>
      <dc:date>2006-06-25T13:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Script at boot up.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811944#M268460</link>
      <description>Hi Rafael:&lt;BR /&gt;&lt;BR /&gt;Start-up and shutdown scripts are quite easy to implement.  In fact, a template exists to expedite the process: '/sbin/init.d/template'.&lt;BR /&gt;&lt;BR /&gt;I urge you to take the few minutes needed to read the whitepaper below.  It applies to all HP-UX releases since 10.x.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.docs.hp.com/en/934/startup.pdf" target="_blank"&gt;http://www.docs.hp.com/en/934/startup.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;A summary of it's key points can also be found in the manpages for 'rc(1M)':&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.docs.hp.com/en/B2355-60127/rc.1M.html" target="_blank"&gt;http://www.docs.hp.com/en/B2355-60127/rc.1M.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 25 Jun 2006 13:11:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811944#M268460</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-06-25T13:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Script at boot up.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811945#M268461</link>
      <description>Hi,&lt;BR /&gt;The the best place to put your startup and shutdown scripts is /sbin/init.d&lt;BR /&gt;Here you have got a file called template which can be used as the template for the script which is used during system starup and shutdown. You can modify this template to put your commands for database startup and shutdown in the corresponding sections of start and stop.&lt;BR /&gt;Then create the soft links in /sbin/rc3.d as&lt;BR /&gt;ln -s /sbin/init.d/oracle Snnnoracle [ Decide this number nnn depending upon when the script should run - the number decides when that script will be run.(higher number scripts will run after the lower number script has been run.)&lt;BR /&gt;Also create a link in /sbin/rc2.d&lt;BR /&gt;ln -s /sbin/init.d/oracle Knnnoracle&lt;BR /&gt;&lt;BR /&gt;There should be standard scripts available for startup and shutdown and am sure someone here might be able to provide you sample script as well.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ninad&lt;BR /&gt;</description>
      <pubDate>Sun, 25 Jun 2006 13:16:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811945#M268461</guid>
      <dc:creator>Ninad_1</dc:creator>
      <dc:date>2006-06-25T13:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Script at boot up.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811946#M268462</link>
      <description>First make sure that all environment variables are set and exported in your script such as ORACLE_SID and PATH.&lt;BR /&gt;&lt;BR /&gt;Next, look in /sbin/init.d for a file called 'template' and copy it to a new file (e.g. /sbin/init.d/dbscript). You will find 4 sections with a case statement: 1) start_msg, 2) start, 3) stop , and 4) stop_msg. Each of these is executed by the rc command when the machine is booted and shutdown. The start_msg and start sections are executed on startup and the stop_msg and stop sections are executed on shutdown. The xxx_msg sections simply echo to the console. The start section should call your "real" startup script and the stop section should call your "real" shutdown script.&lt;BR /&gt;&lt;BR /&gt;So far, you have actually done nothing because those scripys in /sbin/init.d are not actually invoked by rc; you must now create symbolic links. You will probably want to start execution in run-level 3, so create a symbolic link in /sbin/rc3.d (e.g ln -s /sbin/init.d/dbscript /sbin/rc3.d/S750dbscript. The scripts under a giver rc.N directory are executed in lexical order so if your dbscripts requires that other services such as NFS be up first that you Snnn values occur after those that you need first. By convention, the shutdown scripts are executed at run-level - 1 from the start scripts and if you choose 3 digit numbers (zero-padded if necessary) that add&lt;BR /&gt; to 1000, the startup and shutdown scripts almost always occur in correct sequence. &lt;BR /&gt;&lt;BR /&gt;Your symbolic link for the shutdown script should be something very close to this:&lt;BR /&gt;&lt;BR /&gt;ln -s /sbin/init.d/dbscript /sbin/rc2.d/K250dbscript.&lt;BR /&gt;</description>
      <pubDate>Sun, 25 Jun 2006 13:19:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811946#M268462</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-06-25T13:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Script at boot up.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811947#M268463</link>
      <description>Rafael,&lt;BR /&gt;&lt;BR /&gt;If you have a valid "oratab" file and the ORACLE_HOME variable is defined and exported, then follow the steps below...&lt;BR /&gt;&lt;BR /&gt;1. Install the script in the /sbin/init.d directory, name it oracle.&lt;BR /&gt;&lt;BR /&gt;2. make symbolic links to the 2nd  and 3rd run-levels for stopping and starting oracle respectively, like...&lt;BR /&gt;&lt;BR /&gt;ln -s /sbin/init.d/oracle /sbin/rc3.d/S900oracle &lt;BR /&gt;ln -s /sbin/init.d/oracle /sbin/rc2.d/K100oracle&lt;BR /&gt;&lt;BR /&gt;~hope it helps</description>
      <pubDate>Sun, 25 Jun 2006 13:23:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811947#M268463</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-06-25T13:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Script at boot up.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811948#M268464</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;In addition to above, please look at an example of simple oracle start/stop script. In order to use it, create /etc/rc.config.d/oraconf file, which may help you to switch on/off oracle startup.&lt;BR /&gt;&lt;BR /&gt;Please take into account that the script works only when all your databases are built with the same ORACLE_HOME. Additionally pay your attention that listener is started up in its simplest form.&lt;BR /&gt;You may need to update the script according to existing conditions.&lt;BR /&gt;&lt;BR /&gt;Also look at $ORACLE_HOME/bin/dbshut script and add parameter IMMEDIATE or TRANSACTIONAL for each shutdown command in it.</description>
      <pubDate>Sun, 25 Jun 2006 14:31:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811948#M268464</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2006-06-25T14:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script at boot up.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811949#M268465</link>
      <description>The DBA created the script, scripts on runs when you su - oracle user. &lt;BR /&gt;&lt;BR /&gt;How would I get this script to start up when the system boots up ? if it can be done.&lt;BR /&gt;&lt;BR /&gt;Thanks,</description>
      <pubDate>Mon, 26 Jun 2006 21:18:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811949#M268465</guid>
      <dc:creator>Rafael Casero</dc:creator>
      <dc:date>2006-06-26T21:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Script at boot up.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811950#M268466</link>
      <description>&amp;gt;&amp;gt;The DBA created the script, scripts on runs when you su - oracle user.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;How would I get this script to start up when the system boots up ? if it can be done.&lt;BR /&gt;&lt;BR /&gt;Assuming the script your DBA has created is called "start_stop_oracle". Copy this script to "/sbin/init.d" directory. Now create symbolic links to this script in the 2nd and 3rd run levels for stopping and starting it as follows:&lt;BR /&gt;&lt;BR /&gt;# ln -s /sbin/init.d/start_stop_oracle /sbin/rc2.d/S900start_stop_oracle&lt;BR /&gt;# ln -s /sbin/init.d/start_stop_oracle /sbin/rc2.d/K100start_stop_oracle&lt;BR /&gt;&lt;BR /&gt;That's all you have to do for the "script to start up when the system boots up".&lt;BR /&gt;&lt;BR /&gt;~cheers</description>
      <pubDate>Mon, 26 Jun 2006 22:20:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811950#M268466</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-06-26T22:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Script at boot up.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811951#M268467</link>
      <description>The problem is that this script will only execuye has oracle user, it woun't start hass root. &lt;BR /&gt;&lt;BR /&gt;I have done this but no luck...</description>
      <pubDate>Mon, 26 Jun 2006 22:37:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811951#M268467</guid>
      <dc:creator>Rafael Casero</dc:creator>
      <dc:date>2006-06-26T22:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Script at boot up.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811952#M268468</link>
      <description>The su - oracle xxxx command almost certainly has an Achilles' heel and that is the sourcing of oracle .profile. When run interactively, all is well; however, .profile almost certainly has commands like tput, tset, tab, ... which expect stdin to be a terminal-like device which is not the case under rc. The .profile is intended to set and export needed environment variables but this very .profile can cause .profile to hang when stdin is not a tty device. The preferred approach (Method A) is to create a file, e.g. /usr/local/bin/oraenv.sh which sets and exports any needed environment variables. Then both the rc startup/shutdown script and oracle's .profile should source this file using the dot operator.&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;. /usr/local/bin/oraenv.sh&lt;BR /&gt;&lt;BR /&gt;(oraenv.sh must not contain a return or exit statement because this sourced file is actually a part of the foreground process.&lt;BR /&gt;&lt;BR /&gt;That will safely source the file and now you&lt;BR /&gt;do not use the "-" in the su command so that .profile is not used.&lt;BR /&gt;&lt;BR /&gt;Method B is to continue to use "-" and alter .profile so that those tty related commands are ignored:&lt;BR /&gt;&lt;BR /&gt;if [ -t 0 ]&lt;BR /&gt;  then #stdin is a tty device&lt;BR /&gt;    tput ...&lt;BR /&gt;    tset ...&lt;BR /&gt;    stty ...&lt;BR /&gt;    tabs &lt;BR /&gt;  fi&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Jun 2006 22:39:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811952#M268468</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-06-26T22:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Script at boot up.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811953#M268469</link>
      <description>&lt;A href="http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1302619965694." target="_blank"&gt;http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1302619965694.&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Awadhesh</description>
      <pubDate>Mon, 26 Jun 2006 23:36:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811953#M268469</guid>
      <dc:creator>AwadheshPandey</dc:creator>
      <dc:date>2006-06-26T23:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Script at boot up.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811954#M268470</link>
      <description>I must be doing something wrong on my syntax...&lt;BR /&gt;&lt;BR /&gt;miaux10: / =&amp;gt;ln -s /sbin/init.d/oracle_ctl.sh /sbin/rc3.d/S900su - oracle -c '/sbin/init.d/orcale_ctl.sh start'&lt;BR /&gt;Usage: ln [-f] [-i] [-s] f1 f2&lt;BR /&gt;       ln [-f] [-i] [-s] f1 ... fn d1&lt;BR /&gt;&lt;BR /&gt;Please help..</description>
      <pubDate>Tue, 27 Jun 2006 17:06:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811954#M268470</guid>
      <dc:creator>Rafael Casero</dc:creator>
      <dc:date>2006-06-27T17:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Script at boot up.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811955#M268471</link>
      <description>What is this nonsense?&lt;BR /&gt;&lt;BR /&gt;ln -s /sbin/init.d/oracle_ctl.sh /sbin/rc3.d/S900su - oracle -c '/sbin/init.d/orcale_ctl.sh start'&lt;BR /&gt;&lt;BR /&gt;Does oracle_ctl.sh even understand the start|stop|start_msg|stop_msg arguments? &lt;BR /&gt;&lt;BR /&gt;If not, you start with a copy of the template file and within the start) section of you you do your "su - oracle -c oracle_ctl.sh". Your symbolic links link thios template file copy to entries in the rc.N directories. The ln -s command will not pass command line arguments. Man ln would probably help.&lt;BR /&gt;&lt;BR /&gt;I patiently explained all this above and you chose to ignore it. Also, you would be wise to heed my warning about "su - oracle" rather than "su oracle".</description>
      <pubDate>Tue, 27 Jun 2006 17:14:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811955#M268471</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-06-27T17:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Script at boot up.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811956#M268472</link>
      <description>Yes, it understands it |start |stop. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Jun 2006 17:17:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811956#M268472</guid>
      <dc:creator>Rafael Casero</dc:creator>
      <dc:date>2006-06-27T17:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Script at boot up.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811957#M268473</link>
      <description>Hi Rafael:&lt;BR /&gt;&lt;BR /&gt;You need to symbolic link like this:&lt;BR /&gt;&lt;BR /&gt;# ln -s /sbin/init.d/s_k_oracle  /sbin/rc3.d/S900s_k_oracle&lt;BR /&gt;&lt;BR /&gt;NOTE that the basename ("s_k_oracle") is used both in the basename of the '/sbin/init.d' directory and the '/sbin/rc2.d' directory.  Do the same kind of thing for the 'kill' script:&lt;BR /&gt;&lt;BR /&gt;# ln -s /sbin/init.d/s_k_oracle  /sbin/rc2.d/K100s_k_oracle&lt;BR /&gt;&lt;BR /&gt;...but use "K" instead of "S" and follow the "rule-of-1000".&lt;BR /&gt;&lt;BR /&gt;Now, *inside* the '/sbin/init.d/s_k_oracle script you should place the command to switch to the oracle user:&lt;BR /&gt;&lt;BR /&gt;# su oracle -c ' ... ' #...fill in appropriately.&lt;BR /&gt;&lt;BR /&gt;*Now* test by doing:&lt;BR /&gt;&lt;BR /&gt;# /sbin/init.d/s_k_oracle start&lt;BR /&gt;# /sbin/init.d/s_k_oracle stop&lt;BR /&gt;&lt;BR /&gt;If you have used the '/sbin/init.d/template' as a guide, this should work quite well.&lt;BR /&gt;&lt;BR /&gt;Look at the whitepaper I originally suggested, again, along with the 'rc(1M)' manpages and a simple startup script like:&lt;BR /&gt;&lt;BR /&gt;# /sbin/init.d/cron&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Jun 2006 17:27:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-at-boot-up/m-p/3811957#M268473</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-06-27T17:27:12Z</dc:date>
    </item>
  </channel>
</rss>

