cancel
Showing results for 
Search instead for 
Did you mean: 

Order on boot

SOLVED
Go to solution
Juan Manuel López
Valued Contributor

Order on boot

Hi, all.
There is any problem if I put several link on /sbin/rc3.d with the same number ?

S100nfs.server -> /sbin/init.d/nfs.server
S999dbora -> /sbin/init.d/dbora
K100dbora -> /sbin/init.d/dbora

The problem is that I reboot the machine and there is not a normal database stop, so while I start the machine, the bbdd starts right.
The DBA told me the Oracle process are kill with kill -15 ???

The script TO start an shut the bbdd:

case $1 in

start_msg)
echo "Start the Oracle Database and Listener"
;;
stop_msg)
echo "Stop the Oracle Database and Listener"
;;

'start')
/usr/bin/su - oracle8 -c "/oracle/bin/dbstart"
/usr/bin/su - oracle8 -c "/oracle/bin/lsnrctl start LISTENER_STU02"
/usr/bin/su - oracle8 -c "/oracle/bin/lsnrctl start LISTENER_STU022"
;;

'stop')
/usr/bin/su - oracle8 -c /oracle/bin/dbshut_i
/usr/bin/su - oracle8 -c "/oracle/bin/lsnrctl stop LISTENER_STU02"
/usr/bin/su - oracle8 -c "/oracle/bin/lsnrctl stop LISTENER_STU022"
;;

esac

Thanks.
I would like to be lie on a beautiful beach spending my life doing nothing, so someboby has to make this job.
9 REPLIES
Craig Rants
Honored Contributor

Re: Order on boot

No, there is a not a problem having a few S100's or K999's, there are always a few applications that end up using the same number. So in your case you should be good.

GL,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
Juan Manuel López
Valued Contributor

Re: Order on boot

I do not why, so when I reboot the machine or shutdown, do not execute the K100 dbora link.
I would like to be lie on a beautiful beach spending my life doing nothing, so someboby has to make this job.
Jeff Schussele
Honored Contributor

Re: Order on boot

Hi juanma,

There are two rules-of-thumb for startup/stop scripts:

1) The value of the S & K scripts *should* equal 1000 - usually the S is larger.
2) The K stop script *should* be one run-level lower then the S startup scipt.

These are not hard & fast rules and are NOT required.
I guess you could term them "etiquette". I find doing them this way makes it easier to find them when necessary.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
hpuxrox
Respected Contributor

Re: Order on boot

In your case, no. The numbers are only there to set the boot order. If it doesn't matter when your run control script starts or stops. Then the number doesnt matter.

John Palmer
Honored Contributor
Solution

Re: Order on boot

Hi,

Your K100dbora link should be in /sbin/rc2.d not rc3.d.

Placed as it is in rc3.d, it would only get called if you were shutting down from runlevel 4 (or higher).

The runlevel that the system boots to is driven by the init entry (first line) of /etc/inittab. For example...

init:3:initdefault:

The system will boot automatically to runlevel 3.

Regards,
John
Peter Kloetgen
Esteemed Contributor

Re: Order on boot

Hi Juanma,

there is no problem if you have several Start- or Kill- scripts with the same passing number. But please remember, they are run in alphabetical order after the numbers. Are there dependencies, means must one of those scripts with the same numbers been run before another one is run? Would a service been started with one of these scripts not work if another one is not started so far?

If you take care of this problem, this should work for you.

Your DBA is right, oracle is stopped first with killing signal -15. But if this does not work, it's also stopped with kill signal -9 by the killall-script, which kills all services and processes that are not yet stopped. (Kill scripts failed....)

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
Helen French
Honored Contributor

Re: Order on boot

Hi,

I couldn't find 'several links with the same number' in your example. If you are talking about 'S100' and 'K100', then that's not a problem since 'S' stands for start and 'K' stands for kill scripts.

If you are talking about configuring the start and kill scripts in the same run level, then it's not a good practise. Normally if a process starts at run level-2, then the kill script will be in run level-1 and the total number could be '1000' (Sxxx+Kxxx=1000). This is the normal practise.

I would suggest you to put your dbora kill script in /sbin/rc0.d. Always remember to kill the last started process first.

HTH,
Shiju
Life is a promise, fulfill it!
Ceesjan van Hattum
Esteemed Contributor

Re: Order on boot

John is correct. The Kxxx is executed on a lower runlevel.
If you do a 'who -r', your current runlevel is shown.
The Kxxx of the same level will not be executed.

So.. /sbin/init.d/dbora should be linked as:
/sbin/rc3.d/Sxxx and
/sbin/rc2.d/Kyyy
,where xxx+yyy=1000.
But.. as said by others.. a number is just a number.

Regards,
Ceesjan
Juan Manuel López
Valued Contributor

Re: Order on boot

It works, that??s the reason why !
When I stop the machine, it go to level 2 to see what to stop, so the K100dbora on level 3 does not run.
Thank you very much.
I would like to be lie on a beautiful beach spending my life doing nothing, so someboby has to make this job.