Operating System - HP-UX
1826290 Members
4492 Online
109692 Solutions
New Discussion

Re: Shutdown script link naming ?

 
SOLVED
Go to solution
Jeff Zabel
Occasional Advisor

Shutdown script link naming ?

OK, I'm a little confused with the whole linking process. I know how to link the files. But the thing I'm not to sure about is can I have 2 or more links with S900 and 2 or more links with K100. Let me give an example of my potential configuration:

STARTUP/SHUTDOWN SCRIPT #1:

SCRIPT NAME: APP1

START LINK: /sbin/init.d/app1 /sbin/rc3.d/S900app1

STOP LINK:
/sbin/init.d/app1 /sbin/rc3.d/K100app1

SCRIPT NAME: APP2

START LINK: /sbin/init.d/app2 /sbin/rc3.d/S900app2

STOP LINK:
/sbin/init.d/app1 /sbin/rc3.d/K100app2

please notice that my question pretains to the sequence number being identical. Will this be a problem. Thanks in advanced (hopefully this makes sense)
Regards,
4 REPLIES 4
Jeff Schussele
Honored Contributor
Solution

Re: Shutdown script link naming ?

Hi Jeff,

As long as they differ, they're OK. Scripts are ran alphabatically. IF you need one to start AFTER another they would have to be alphabetically arranged that way. BUT you can always change the digits somewhat.

Like S900app1 & K100app1 THEN S920app2 & K080app2 - app2 will start after & stop before app1
It's good that you're respecting the rule of 1000. And that's to insure proper start/stop order.

AND REMEMBER that if you start it in run-level 3 (/sbin/rc3.d) you should stop it it run-level 2 (/sbin/rc2.d) on the way down. Always stop one level lower than start.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Darrell Allen
Honored Contributor

Re: Shutdown script link naming ?

Hi Jeff,

To answer your question: yes, you can use the same prefix for multiple links. S900app1 will run before S900app2. As Jeff says, the scripts are run in alphabetical order. If you need app2 to run before app1, then obviously you will have to change the name of the links.

It is easier to determine the order if you use different numbers, however it is not a requirement.

Let me also echo what Jeff says about the placement of the start and stop scripts. The stop script needs to be in a run level that is less than the start script. Generally, that will be one run level less.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
A. Clay Stephenson
Acclaimed Contributor

Re: Shutdown script link naming ?

I suppose to be ultra-nit-picky, 'alphabetical' should be amended to 'lexical' order. As has been stated, the SNNN value + the Knnn value should equal 1000 but that is simply convention.
If it ain't broke, I can fix that.
Jeff Zabel
Occasional Advisor

Re: Shutdown script link naming ?

Thank you all for your responses. I feel much more confortable about the naming now.

Regards,