1831670 Members
2055 Online
110029 Solutions
New Discussion

rc3.d

 
SOLVED
Go to solution
lastgreatone
Regular Advisor

rc3.d

Shouldn't the KILL script be in the rc2.d, which is one directory below the run level? My peers decided the Start and Kill scripts for Oracle should be in rc3.d. (They originally had it in rc1.d). BTW the NFS kill is in rc2.d.

TIA
8 REPLIES 8
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: rc3.d

Hi Frankie:

You are correct. The rule is that the kill script goes in one run-level below that of the start script. e.g If your start script is
/sbin/rc3.d/S910oracle then your kill script should be /sbin/rc2.d/K090oracle. The other convention (though not a requirement) is that the 3 digits of both scripts should add to 1000. This almost always brings them up and down in the intended order. I have also implemented Oracle to start in rc4.d and stop in rc3.d assuming the default run-level is 4.

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

Re: rc3.d

Hi Frankie:

In order to meet dependency requirements, services are generally killed in the reverse order from which they are started.

For example, assume there are four services, W, X, Y, and Z. The S/K script names for these
services would likely be:

/sbin/rc3.d: /sbin/rc2.d:
------------ ------------
S200W K800W
S300X K700X
S400Y K600Y
S500Z K500Z

Regarding NFS, the startup scripts are in:

NFS core /sbin/rc2.d
NFS client /sbin/rc2.d
NFS server /sbin/rc3.d

Shawn

Animesh Chakraborty
Honored Contributor

Re: rc3.d

Animesh Chakraborty
Honored Contributor

Re: rc3.d

A. Clay Stephenson
Acclaimed Contributor

Re: rc3.d

Hi Frankie:

One other point, if both the start and kill scripts trigger at the same run-level and that level is the default run-level as set by the initdefault entry in /etc/inittab, the kill script will not even be triggered. That is why you always kill at run-level - 1.

Regards, Clay
If it ain't broke, I can fix that.
Scott Van Kalken
Esteemed Contributor

Re: rc3.d

General rule of thumb also is that the start and kill script numbers should add up to 1000 (it's a neatness thing)
James R. Ferguson
Acclaimed Contributor

Re: rc3.d

Hi Frankie:

'Kill' scripts should execute at one run-level lower than their 'start' counterpart, for the reason that Clay clearly states in his second post.

In addition the "1000-rule", when followed, means not only that processes will be killed in in the *reverse* order that they were started, but that processes will *not* be killed until a potentially dependent process is first killed.

Consider processes A, B and C started at run-level-3 as S100A, S400B and S900C. Assume further that S400B is dependent upon some service provided by S100A. The proper kill scripts would be at run-level-2 and respectively be K100C, K600B and K900A. Thus, "B" would be gracefully terminated before "A"'s service is killed.

Regards!

...JRF...
Darrell Allen
Honored Contributor

Re: rc3.d

Hi Frankie,

Aside from being a good convention, the kill script MUST be in a lower level from the start script or it will not be executed (see /sbin/rc). It is only executed when changing run-level to it's level or a lower level. For example, changing from run-level 3 to 1 executes Kill scripts in rc2.d and rc1.d.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)