Changing runlevel priorities
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?? I tried with yast and chkconfig, but it didn't work. Thanks -- Thiago Vinhas de Moraes CODIN - Cia. de Desenvolvimento Industrial do Estado RJ Departamento de Informática email: tvinhas@codin.rj.gov.br Tel: (21) 2517-5411 "Somos aquilo que fazemos consistentemente. Assim, a excelência não é um ato, mas sim um hábito."
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
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.
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
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Tuesday 2005-06-14 at 04:14 -0800, Greg Wallace wrote:
Basically, you can just move (mv) the links in /etc/init.d/rc5.d to a different number.
You should *never* do that in a SuSE system. Yast will undo your changes at the first oportunity. Read "man init.d" and the "The SuSE boot concept" chapter in the admin book. Plus some undocumented changes in 9.3. - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFCrtWGtTMYHG2NR9URAsUEAJ9bFL/XioQFBM2LcdCujJsq4MgXqQCeJhIL z6jRLEUxB3jGHW2jfCopf/4= =Ep1w -----END PGP SIGNATURE-----
Carlos E. R. wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
The Tuesday 2005-06-14 at 04:14 -0800, Greg Wallace wrote:
Basically, you can just move (mv) the links in /etc/init.d/rc5.d to a different number.
You should *never* do that in a SuSE system. Yast will undo your changes at the first oportunity.
Read "man init.d" and the "The SuSE boot concept" chapter in the admin book. Plus some undocumented changes in 9.3.
But I think that if you edit inittab manually, and change the values, I thik that it can be do! I don't know! But is not necessary to change 5 to 4, add all that you want in 5 -- ------------------------------------------------------ Una prensa libre es el gran enemigo de los dictadores. Independientemente de sus abusos, sus debilidades, sus errores. Una prensa libre es la gran aliada y defensora de la democracia. Charlos S. Shapiro Embajador de USA en la Rep. de Venezuela Martes, 20 de Mayo 2003
Hipolito A. Gonzalez M. wrote:
Carlos E. R. wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
The Tuesday 2005-06-14 at 04:14 -0800, Greg Wallace wrote:
Basically, you can just move (mv) the links in /etc/init.d/rc5.d to a different number.
You should *never* do that in a SuSE system. Yast will undo your changes at the first oportunity.
Read "man init.d" and the "The SuSE boot concept" chapter in the admin book. Plus some undocumented changes in 9.3.
But I think that if you edit inittab manually, and change the values, I thik that it can be do! I don't know! But is not necessary to change 5 to 4, add all that you want in 5
We're talking about the run sequence within a run level, not starting a different run level. The usual run levels are 5, with desktop or 3 without. Levels 1 & 2 are not normal run levels and 4 is usually not used. Levels 0 and 6 are for rebooting or halting the system.
James Knott wrote:
Hipolito A. Gonzalez M. wrote:
Carlos E. R. wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
The Tuesday 2005-06-14 at 04:14 -0800, Greg Wallace wrote:
Basically, you can just move (mv) the links in /etc/init.d/rc5.d to a different number.
You should *never* do that in a SuSE system. Yast will undo your changes at the first oportunity.
Read "man init.d" and the "The SuSE boot concept" chapter in the admin book. Plus some undocumented changes in 9.3.
But I think that if you edit inittab manually, and change the values, I thik that it can be do! I don't know! But is not necessary to change 5 to 4, add all that you want in 5
We're talking about the run sequence within a run level, not starting a different run level. The usual run levels are 5, with desktop or 3 without. Levels 1 & 2 are not normal run levels and 4 is usually not used. Levels 0 and 6 are for rebooting or halting the system.
Ok. I understard!!!! Is very very easy. Enter is /etc/rc.d/rc5.d and you are watching the runlevel 5 with the order S01 means= Start in order 01 S10 menas= 10 > 1, after 1, if not 2 3 4 5 .... Always the minor number to the mayor number! You can modify the link names, and you are changing the order The K is for killing!!! -- ------------------------------------------------------ Una prensa libre es el gran enemigo de los dictadores. Independientemente de sus abusos, sus debilidades, sus errores. Una prensa libre es la gran aliada y defensora de la democracia. Charlos S. Shapiro Embajador de USA en la Rep. de Venezuela Martes, 20 de Mayo 2003
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Wednesday 2005-06-15 at 17:12 -0400, Hipolito A. Gonzalez M. wrote:
You can modify the link names, and you are changing the order
Yes, but do _not_ modify them in a SuSE system! - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFCsKvHtTMYHG2NR9URAoiaAJ4iIsDGlMjzH8ps1GMPtd8BGuKsbQCeNso8 SS4nLYv6N8KcLOewiERBCck= =QfiX -----END PGP SIGNATURE-----
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??
I tried with yast and chkconfig, but it didn't work.
The script boot.local runs before any of those Sxx or Kxx scripts, and even before changing to a run level.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Monday 2005-06-13 at 18:41 -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??
I tried with yast and chkconfig, but it didn't work.
The order is calculated from the "Required-Start:" and "Required-Stop:" lines in the scripts. You will have to play with them till chkconfig insert it in the wanted order. Or, put it in "boot.local", if possible, because, as James said, it is run before any of the runlevel scripts. - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFCruUUtTMYHG2NR9URAhHAAJ96Q0YKopjfhtQKHSIOqsQFXv/xIQCdFfD4 +tzmTYV5FTUf9jXAxIGmZuw= =coHK -----END PGP SIGNATURE-----
Tue, 14 Jun 2005, by robin1.listas@tiscali.es:
The Monday 2005-06-13 at 18:41 -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??
I tried with yast and chkconfig, but it didn't work.
The order is calculated from the "Required-Start:" and "Required-Stop:" lines in the scripts. You will have to play with them till chkconfig insert it in the wanted order.
Or, put it in "boot.local", if possible, because, as James said, it is run before any of the runlevel scripts.
Caution: that'll only work for services that do /not/ need network. Theo -- Theo v. Werkhoven Registered Linux user# 99872 http://counter.li.org ICBM 52 13 26N , 4 29 47E. + ICQ: 277217131 SUSE 9.2 + Jabber: muadib@jabber.xs4all.nl Kernel 2.6.8 + See headers for PGP/GPG info. Claimer: any email I receive will become my property. Disclaimers do not apply.
Theo v. Werkhoven wrote:
Tue, 14 Jun 2005, by robin1.listas@tiscali.es:
The Monday 2005-06-13 at 18:41 -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??
I tried with yast and chkconfig, but it didn't work. The order is calculated from the "Required-Start:" and "Required-Stop:" lines in the scripts. You will have to play with them till chkconfig insert it in the wanted order.
Or, put it in "boot.local", if possible, because, as James said, it is run before any of the runlevel scripts.
Caution: that'll only work for services that do /not/ need network.
I no longer have the original message, but I believe the OP wanted something to start before networking.
Tue, 14 Jun 2005, by james.knott@rogers.com:
I no longer have the original message, but I believe the OP wanted something to start before networking.
No need to (i.e.: do *not*) send me a copy, when someone response to a post here, you can expect him or her to actually read the list. Theo -- Theo v. Werkhoven Registered Linux user# 99872 http://counter.li.org ICBM 52 13 26N , 4 29 47E. + ICQ: 277217131 SUSE 9.2 + Jabber: muadib@jabber.xs4all.nl Kernel 2.6.8 + See headers for PGP/GPG info. Claimer: any email I receive will become my property. Disclaimers do not apply.
Theo v. Werkhoven wrote:
Tue, 14 Jun 2005, by james.knott@rogers.com:
I no longer have the original message, but I believe the OP wanted something to start before networking.
No need to (i.e.: do *not*) send me a copy, when someone response to a post here, you can expect him or her to actually read the list.
If I send someone a copy, in addition to the one to the list, it's because I forgot to change the reply address from the sender, to the list. If you check you'll find the two copies have different times and no cc:.
Wed, 15 Jun 2005, by james.knott@rogers.com:
Theo v. Werkhoven wrote:
Tue, 14 Jun 2005, by james.knott@rogers.com:
I no longer have the original message, but I believe the OP wanted something to start before networking.
No need to (i.e.: do *not*) send me a copy, when someone response to a post here, you can expect him or her to actually read the list.
If I send someone a copy, in addition to the one to the list, it's because I forgot to change the reply address from the sender, to the list. If you check you'll find the two copies have different times and no cc:.
Ack. Now if you'd use a *list-aware* mailclient OTOH.. Theo -- Theo v. Werkhoven Registered Linux user# 99872 http://counter.li.org ICBM 52 13 26N , 4 29 47E. + ICQ: 277217131 SUSE 9.2 + Jabber: muadib@jabber.xs4all.nl Kernel 2.6.8 + See headers for PGP/GPG info. Claimer: any email I receive will become my property. Disclaimers do not apply.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Wednesday 2005-06-15 at 22:08 +0200, Theo v. Werkhoven wrote:
Ack. Now if you'd use a *list-aware* mailclient OTOH..
Mozilla is a... notorious mail client, that is not mail list aware. - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFCsI7CtTMYHG2NR9URAqb3AJ46CUiwdmjHGK4kwtGaxxOakaU2dwCeLckW pHPCNq4Hau6HROeZuLiEghw= =4XEl -----END PGP SIGNATURE-----
The only way I know how to change the order of execution is by hand tweeking it. I would go to the /etc/init.d/rc5.d and rename the link say from S18.xdm to S10.xdm. This will then execute before all startup scripts lexically S10. Note that the capital S is essential otherwise it will not execute/ James Knott wrote:
Theo v. Werkhoven wrote:
Tue, 14 Jun 2005, by robin1.listas@tiscali.es:
The Monday 2005-06-13 at 18:41 -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??
I tried with yast and chkconfig, but it didn't work.
The order is calculated from the "Required-Start:" and "Required-Stop:" lines in the scripts. You will have to play with them till chkconfig insert it in the wanted order.
Or, put it in "boot.local", if possible, because, as James said, it is run before any of the runlevel scripts.
Caution: that'll only work for services that do /not/ need network.
I no longer have the original message, but I believe the OP wanted something to start before networking.
-- Joseph Loo jloo@acm.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Tuesday 2005-06-14 at 21:39 -0700, Joseph Loo wrote:
The only way I know how to change the order of execution is by hand tweeking it. I would go to the /etc/init.d/rc5.d and rename the link say from S18.xdm to S10.xdm. This will then execute before all startup scripts lexically S10. Note that the capital S is essential otherwise it will not execute/
But that method is guraranteed to fail sooner or later, because Yast will revert it as soon as it has a chance. This is documented. - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFCsBvytTMYHG2NR9URAtoXAJsG8qgifmZxiCnSIk+M0WT+p9P2AACglgbi J9zvBLVYM7lYJM4kG/w04Jc= =jrAg -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Tuesday 2005-06-14 at 23:15 +0200, Theo v. Werkhoven wrote:
Or, put it in "boot.local", if possible, because, as James said, it is run before any of the runlevel scripts.
Caution: that'll only work for services that do /not/ need network.
Mmm. That "caution" is inexact. It will only work for services that do not need _any_ other service whatsoever! That is implicit in saying that boot.local runs "before any of the runlevel scripts". - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFCr2oRtTMYHG2NR9URAhflAJ0QbUBz/61O2jITKP2P9NS6H+kD7QCfacyJ T4oOep7lCBPhOQnJ1hCtFsQ= =Rso3 -----END PGP SIGNATURE-----
Wed, 15 Jun 2005, by robin1.listas@tiscali.es:
The Tuesday 2005-06-14 at 23:15 +0200, Theo v. Werkhoven wrote:
Or, put it in "boot.local", if possible, because, as James said, it is run before any of the runlevel scripts.
Caution: that'll only work for services that do /not/ need network.
Mmm. That "caution" is inexact. It will only work for services that do not need _any_ other service whatsoever!
You're right. Thanks. Theo -- Theo v. Werkhoven Registered Linux user# 99872 http://counter.li.org ICBM 52 13 26N , 4 29 47E. + ICQ: 277217131 SUSE 9.2 + Jabber: muadib@jabber.xs4all.nl Kernel 2.6.8 + See headers for PGP/GPG info. Claimer: any email I receive will become my property. Disclaimers do not apply.
participants (9)
-
Carlos E. R.
-
Greg Wallace
-
Hipolito A. Gonzalez M.
-
James Knott
-
Joseph Loo
-
Kastus
-
Ken Schneider
-
Theo v. Werkhoven
-
Thiago Vinhas de Moraes