1849262 Members
6862 Online
104042 Solutions
New Discussion

Re: shutdown

 
augusto cossa
Frequent Advisor

shutdown

Hi,

In HP-UX 10.20,

I want to include on shutdown -r -y 0 script the followings:


/usr/bin/su -u res -c "/stm/res/sh/ec_stop.sh res"

/usr/bin/su -u oracle -c "/oracle/product/8.0.5/bin/dbshut"

/usr/bin/su -u oracle -c "/oracle/product/8.0.5/bin/dbstart"

/usr/bin/su -u res -c "/stm/res/sh/ec_start.sh res"

Thanks

Augusto
5 REPLIES 5
Andy Monks
Honored Contributor

Re: shutdown

Have a look at the files start_up.txt and sequence.txt in /usr/share/doc

it will describe how to add/remove things to startup/shutdown.

There is a template script in /sbin/init.d/template
Stefan Farrelly
Honored Contributor

Re: shutdown


You really want 2 scripts in /sbin/init.d, one for oracle and one for res. Each one should look something like this;

#!/sbin/sh
PATH=/sbin:/usr/sbin:/usr/bin
export PATH

case $1 in
start_msg)
echo "Start Oracle"
;;
stop_msg)
echo "Stop Oracle"
;;
start)
/usr/bin/su -u oracle -c "/oracle/product/8.0.5/bin/dbstart"
;;
stop)
/usr/bin/su -u oracle -c "/oracle/product/8.0.5/bin/dbshut"
;;
*)
echo "Usage: $0 start|stop" >&2
exit 1
;;
esac


And modify the necessary bits above for the res script. Now, to start/stop oracle/res do /sbin/init.d/<script> start or stop. To hook them into the startup/shutdown you need to add a symbolic link in /etc/rc.d depending on which runlevel you want them to start stop. Oracle should be in rc3.d to start and rc2.d to stop, same for res. This symbolic link points to /sbin/init.d/<script> and will be run when the system boots/shutsdown. The Links start with Kxxx for shutdown and Sxxx for startup. You will see lots of other links in these directories, set yours up the same.
Im from Palmerston North, New Zealand, but somehow ended up in London...
John Palmer
Honored Contributor

Re: shutdown

The Snnn and Knnn soft link names are significant in that the scripts are run in numerical order of nnn so you might want to have say S900oracle/S901res so that oracle will start first and K99res/K100oracle so that res closes before oracle.
CHRIS_ANORUO
Honored Contributor

Re: shutdown

Hi Augusto,

See the solution to your question from this previous thread through this link: http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x5195c3d7fb78d4118fef0090279cd0f9,00.html

When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
James R. Ferguson
Acclaimed Contributor

Re: shutdown

Hi:

An excellent whitepaper on the architecture of startup & shutdown, in general, can be downloaded from:

http://docs.hp.com/hpux/content/startup.pdf

This will describe the proper way of setting up startup and shutdown of tasks in a prescribed order. Since the standard system processes are done here, you will see how and where to interleave your own (see the comments in Stefan's post, above, in particular.

...JRF...