1847352 Members
4406 Online
110264 Solutions
New Discussion

init file

 
augusto cossa
Frequent Advisor

init file

Hi,

I'm running HP-UX 10.20 and I would like to include the oracle start script so that can be started when start the server. Where should I include that line?

Help PLease.

A Cossa.
8 REPLIES 8
melvyn burnard
Honored Contributor

Re: init file

There should be a file file_sys.txt in the /usr/share/doc directory. If you read this, section 3 discuss the system startup/shutdown model, and particularly section 3.2.6 Adding Your Own Subsystem
This will give the information you need to accomplish teh teask
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
James R. Ferguson
Acclaimed Contributor

Re: init file

Augusto:

See: /usr/share/doc/start_up.txt. This discusses the startup and shutdown script processes.

...JRF...
James R. Ferguson
Acclaimed Contributor
augusto cossa
Frequent Advisor

Re: init file

Thanks to all but what I realy need is to include some shell script to be run when the server is booted automaticaly. So where should I writte them?

Thanks,

Augusto
James R. Ferguson
Acclaimed Contributor

Re: init file

Augusto:

My personal preference is still the rc.d directory (see documentation previously cited). There is a template file discussed in the documentation which I suggest you use. If you only need a startup script and not a kill script, that's OK. You don't have to create a link for a kill script.

...JRF...
Kofi ARTHIABAH
Honored Contributor

Re: init file

Augusto:

The made above suggestions are what you should follow. To summerise:

1. create a Start/Stop script as prescribed by http://us-support.external.hp.com/login/bin/doc.pl/screen=loginDoLogin/sid=94ed7ab101d029e193

2. Save it as say /sbin/init.d/oracle (verify that it is executable)

3. Create a soft link to
ln -s /sbin/init.d/oracle /sbin/rc2.d/S990oracle ; ln -s /sbin/init.d/oracle /sbin/rc1.d/K100oracle

4. Create a /etc/rc.config.d/oralce file that contains the start-up variable.

5. Test with /sbin/rc2.d/S990oracle start
nothing wrong with me that a few lines of code cannot fix!
Victor BERRIDGE
Honored Contributor

Re: init file

And to complete here is a start/stop script for you to adapt to your needs (paths etc...)
rc.oracle:
#!/usr/bin/ksh
export ORACTI_EXPLOIT=/opt/oracle/admin/exploit
export PATH=$PATH:/usr/bin:$ORACTI_EXPLOIT/proc


case "$1" in
start_msg)
echo "Start Oracle"
;;
stop_msg)
echo "Stop Oracle"
;;
start)
$ORACTI_EXPLOIT/proc/db_start
su - oracle -c $ORACTI_EXPLOIT/proc/net_start
;;
stop)
su - oracle -c $ORACTI_EXPLOIT/proc/net_stop
$ORACTI_EXPLOIT/proc/db_shut
;;
*)
echo "usage: $0 {start|stop}"
#rval=1
;;
esac

Good luck
Victor
CHRIS_ANORUO
Honored Contributor

Re: init file

To add to Kofi's contribution, in /oracle/bin, there are dbstart and dbshut files for oracle startup and shutdown. You can link this files from /sbin/init.d start/stop file and allow the scripts be started from /sbin/rc3.d and stopped from /sbin/rc1.d. See attached
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.