1837260 Members
2409 Online
110115 Solutions
New Discussion

Boot startup scripts

 
Celeste_1
New Member

Boot startup scripts

I just built a new HP-UX rp5470 running HP-UX 11.0. Where do I put the Oracle database startup scripts and other app startup scripts, so that they will start upon boot?

AIX person converting to HP.

Much thanks.
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: Boot startup scripts

If you are familiar with other flavors od UNIX, HP-UX will be very familiar. The only quirkiness is HP's convention to put the scripts in /sbin/init.d. The 'S' and 'K' scripts are then symbolic links from /sbin/rcN.d/ to the actual scripts in /sbin/init.d.

There will be a template file in /sbin/init.d that you can copy and use for your own purposes.

If it ain't broke, I can fix that.
Michael Tully
Honored Contributor

Re: Boot startup scripts

There is a template that can be used in /sbin/init.d

HPUX uses a numbering system 'S' for start and 'K' for kill in /sbin/rcN.d. These scripts are symbolic links from /sbin/init.d. The 'N' is the actual run level derived.

Regards
Michael
"When I have trouble spelling, it's called fat finger syndrome"
Anyone for a Mutiny ?
Patrick Wallek
Honored Contributor

Re: Boot startup scripts

You might also want to have a read through /usr/share/doc/start_up.txt and /usr/share/doc/sequence.txt

These 2 documents outline how the startup / shutdown scripts work.
Uday_S_Ankolekar
Honored Contributor

Re: Boot startup scripts

Welcome to HP

/sbin/rc*d is the directory where you put all the startup and shutdown scripts.

read /usr/share/doc/start_up.ttxt for detailed information

-USA..
Good Luck..
James R. Ferguson
Acclaimed Contributor

Re: Boot startup scripts

Hi Celeste:

Yes, AIX is a bit different, although it does support the 'rc' mechanism too. HP-UX makes almost ubiquitous use of it.

If you want a more detailed explanation of the run-level start/stop paradigm this whitepaper is an excellent quick reference:

http://docs.hp.com/hpux/onlinedocs/os/startup.pdf

Several points are worth emphasis:

The file /sbin/init.d/template is a good starting place for making your own start/stop scripts. Each script in '/sbin/init.d' should perform BOTH the startup and shutdown functions. In order to control the functionality within the script, each must also support standard arguments and exit codes. Scripts must be written for the POSIX shell. A template script may be found in '/sbin/init.d/template'.

There is no reason why the startup and shutdown script cannot start/kill multiple, but related processes. Remember to choose the appropriate rc.d directory -- one (1) is for core services; two (2) is for multiuser run-state; three (3) is for networked, multi-user; and four (4) is for graphical interfaces. Depending on the processes you are starting, or stopping, you want to make sure prerequisite services exist.

Each script in /sbin/init.d performs BOTH the startup and shutdown functions, and each will have two links pointing towards the script from /sbin/rc*.d: one for the start action and one for the stop action.

Start scripts begin with "S"; Kill (stop) scripts begin with "K". The order of execution for kill scripts is the reverse of the startup ones.

If a start script is placed in directory '/sbin/rc{X}.d' then its corresponding kill script is put in directory '/sbin/rc{X-1}.d'

A general rule-of-thumb is that the sequence number of the start script plus the sequence number of the kill script should add to 1000.

Subsystems should be killed in the opposite order they were started. This implies that kill scripts will generally not have the same numbers as their start script counterparts. If two subsystems must be started in a given order due to dependencies (e.g., S200sys1 followed by S300uses_sys1), the counterparts to these scripts must be numbered so that the subsystems are stopped in the opposite order in which they were started (e.g., K700uses_sys1 followed by K800sys1). The '1000' rule leads to this behavior.

In general, user applications would be started at runlevel-3 (i.e. /sbin/rc3.d/) and killed in runlevel-2 (i.e. /sbin/rc2.d).

Regards!

...JRF...