Operating System - HP-UX
1838571 Members
3411 Online
110128 Solutions
New Discussion

Re: Startup Scripts Numbering

 
SOLVED
Go to solution
Chris Graham_2
Occasional Contributor

Startup Scripts Numbering

In the start_up.txt/ps document, it explains all of the steps needed to create, install and run system startup scripts for HP-UX.

It also states that developers should contact HP to obtain a number (as in Sxxx) so that it does not override anyone else.

It does not give a contact address though.

So, can anyone give me the contact details of someone to talk to to obtain three numbers?

Or do I just make them up and hope for the best?

-Chris
8 REPLIES 8
James A. Donovan
Honored Contributor
Solution

Re: Startup Scripts Numbering

You can pretty much just make them up yourself. Even if you have two scripts with identical numbers, both scripts will still be run. More important is the placement of the script in a good position. You don't want to run a script that starts a service dependent on the network prior to the network being configured!
Remember, wherever you go, there you are...
Charles Harris
Super Advisor

Re: Startup Scripts Numbering

Hi,

I wouldn't worry about the getting a number assigned, the name of you startup script will most likley be different to any other application you install so the number itself should cause you any issue. The document you read was probably refering to people developing 'HPUX' application in an ideal world.

-=ChaZ=-
Steven E. Protter
Exalted Contributor

Re: Startup Scripts Numbering

You don't need to contact anyone. Strange doc you found, if you post I link, I'd like to read it.

Any soft link in /sbin/rc#.d the # replaced by a number less than or equal to your final run level in /etc/inittab (who -r as root) that starts with a capital S will run.

The numbers affect the run order.

If I have to run a script to allow oracle to access shared memory I want it to run prior to the one that starts up oracle.

/sbin/rc3.d/S800oraprep
will run before
/sbin/rc3.d/S810orastart

Which is what I need.

As I'm sure your doc indicates the S file is a soft link to a startup script in /sbin/init.d

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jeff Schussele
Honored Contributor

Re: Startup Scripts Numbering

Hi Chris,

You don't need anybody to assign numbers. You assign them according to just where in the startup/shutdown process you need/want them to run.
In startup the highest S# in that runlevel runs last. In shutdown the lowest K# in that runlevel runs first.
Custom is that S + K = 1000 i.e. last started - will always be first stopped. You also want to verify just which runlevel to start & stop. Most SW products - not all - start in 3 & stop in 2. Custom is to stop one lower level than start i.e. K/level = S/level - 1

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
A. Clay Stephenson
Acclaimed Contributor

Re: Startup Scripts Numbering

The only thing that should drive you is when your scripts should start and stop.
For example, if your application depend upon the network being fully up including NFS, you simply need to make sure that your SNNN filename is lexagraphically later that the NFS startups. Remembers it the number + the filename that's unique. You could have a hundred S900's as long as the remainder of the filenam doesn't conflict with anything else. In general if your 'S' scripts runs at run-level 'n' the the 'K' sript runs at run-level 'n - 1'. A standard practice is that SNNN + Knnn = 1000 (and always pad w leading zeroes) because this is lexical not numerical. e.g. S100myfile would run before S9yourfile (but not S090yourfile). Even the adding to 1000 is simply a convention - the real deal is making sure that your scripts run when you want them to.

If it ain't broke, I can fix that.
Dave La Mar
Honored Contributor

Re: Startup Scripts Numbering

Chris -
Attached is the doc I have used, found on the forum, and found very usefull in created and testing statups. The version may not match but the process should be the same. We are 11.0

Regards,
dl
"I'm not dumb. I just have a command of thoroughly useless information."
Chris Graham_2
Occasional Contributor

Re: Startup Scripts Numbering

Dave + Steven + et. al.,

Thanks for the replies!

Damn that was quick.

Steven: Look in section 4.1.1 of the PDF file that Dave attached, or look in /usr/share/doc/start_up.ps (which is what I did).

The most important point was that the numbers can indeed be the same, as the rest of the filename (the bit) makes it lexically different (and a unique name!) and they all get run.

I got stuck in my thinking that the numbers needed to be different; which they don't.

Thanks to all for answering.

Now I can finish documenting how to install DB2 and WebSphere under UX! :-)))

-Chris
Steven E. Protter
Exalted Contributor

Re: Startup Scripts Numbering

I've read the doc. Commercially available programs may require particular number sequences.

I imagine some applications may require certain sequence numbers. That is probably so that certain OS necssary services are up at start time or because the product needs multiple sequence numbers.

I see on Linux systems duplicate sequence numbers all the time. I've never tried it on HP-UX.

The document which I've circulated a few times is a very good document, even though its aimed at 10.20 I guess its so good nobody needed to change anything to make it 11.00 compliant.

After another careful read I would say that in almost any circumstance you will have no trouble with sequence numbers. Oracle for example requires you do do it yourself and doesn't even provide a script for /sbin/init.d even after its overly complex graphical isntallation.

Just pick a sequence number that works for you.

Thanks for the points and enjoy your work.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com