On Tue, 2005-06-14 at 04:14 -0800, Greg Wallace wrote:
On Monday, June 13, 2005 @ 1:47 PM, Kastus wrote:
On Mon, Jun 13, 2005 at 06:41:17PM -0300, Thiago Vinhas de Moraes wrote:
Does anyone knows how to change the order of the runlevel scripts? I have a particular init script that I would like to be executed before all other scripts??
Read insserv(8) man page, it explains how dependencies are calculated.
-Kastus
Basically, you can just move (mv) the links in /etc/init.d/rc5.d to a different number. They run in ascending numerical order and, within that, alphabetically. The S's are startups and the K's are kills for when the system goes down. The kills generally run in the reverse order of the starts; i. e., first to come up, last to go down. So, if you wanted something called S05XXX to run after S10YYY, you could just mv S05XXX to, say, S11SXXX. You just need to be aware that there are some dependencies, so if you move something to after something else that's dependent on it you could cause a problem. If you tweak the S for a routine, you should look to do more or less the reverse on the K. In the above example, maybe you'd move K05XXX to K09XXX. I'd make note of the old and new numbers so I could reverse the process if I introduced problems.
Greg W.
This is no longer true since 9.2 I believe. This has to be configured in the runlevel script. Please look at /etc/init.d/skeleton for more info. Also whenever you run insserv it will change the S* and K* to conform to the required start params in the init files. -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 "The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners." -Ernst Jan Plugge