1753925 Members
9102 Online
108810 Solutions
New Discussion юеВ

Startup Process

 
SOLVED
Go to solution
Vogra
Regular Advisor

Startup Process

Hi All!
what the numbers can I use to create my own startup/kill (like S900bdup/K100bddown) scripts on the UX11.0 ?
We are spirits in the material world
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor
Solution

Re: Startup Process

Hi:

First, if a start script is place 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.

HP's "official" recommendation is that run-level-2, sequence number 900 for start scripts and run-levl-1, sequence number 100 for kill scripts, can be freely used. In fact, these numbers can be used more than once, since the concatenated script filename makes the entry unique. Lexographical ordering of the filename portion then resolves the order of execution.

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: Startup Process

Hi Claudio,

I would add one more thing to James's response.
By calling your scripys ...bdup and bddown you are not quite playing by the rules. You are not wrong just not standard.

1) Start by copying /sbin/init.d/template to /sbin/init.d/bd

2) This script should do both the down operation and the up operation. When it is executed by the startup/shutdown process rc, it is called with one of 4 arguments.

a) start_msg - Usually something like echo "Starting bd"
b) stop_msg - Usually echo "Stopping bd"
c) start - this section starts your process
d) stop - this section stop your process

The exit values are important but the template file will show you what these values should be.
The main idea is all operations are in one place and you only change one file. If you need to manually start or stop bd, you simple execute /sbin/init.d/bd start (or stop).

3) Finally you create symbolic links from this bd file to the rcx.d directories. e.g.
ln -s /sbin/init.d/bd /sbin/rc3.d/S900bd
ln -s /sbin/init.d/bd /sbin/rc2.d/K100bd

Note that the convention is to prefix the original name with SNNN and Knnn.

If you do it like this, every unix guy on the planet will know how to safely modify/maintain your scripts.

Regards, Clay
If it ain't broke, I can fix that.

Re: Startup Process

A good source of information on startup scripts is the document

/usr/share/doc/start_up.txt (text version)
/usr/share/doc/start_up.ps (postscript version)

It's titled 'HP-UX 10.X Startup and Configuration', but it's equally valid for HP-UX11.X

I am an HPE Employee
Accept or Kudo
Shahul
Esteemed Contributor

Re: Startup Process

Hi

U keep ur script in /sbin/init.d directory and make a link to /sbin/rcx.d.

Suppose U want to start ur script in runlevel 3 then U will have to put script in rc3.d and for killing in rc2.d. Follow this
#ln -s /sbin/init.d/script /sbin/rc3.d/Sxxxscript

Here xxx is any digits depend up on in what sequence U want to run ur script.

This U should kill in runlevel 2
#ln -s /sbin/init.d/script /Sbin/rc2.d/Kyyyscript

Here yyy is 1000-xxx.

Best of luck

Shahul