Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Init script order tweaking
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
jkroon
Tux's lil' helper
Tux's lil' helper


Joined: 15 Oct 2003
Posts: 110
Location: South Africa

PostPosted: Thu Jan 04, 2007 10:33 am    Post subject: Init script order tweaking Reply with quote

Hi guys,

I know it's possible to control the startup order of services to an extent with the depend() function inside the startup scripts, but what happens when this is no longer sufficient?

Basically, my situation is this, I've got a slowish server and some services (dhcp) is more important than others (say apache or mysql). Now, none of these really depend on one another, and whilst I could go with before and after inside the depend() function, simply adding before * causes warnings to be emitted by depscan.sh.

I'm wondering whether there is another way, perhaps to give each service a priority (just a normal integer value) which will order the services that can be started simultaniously. For exmple, let's say we have three services, A, B and C, both B and C depends on A, so initially only A can be started, but once A has been started rc needs to pick between B and C ... this choice is pretty much arbitrary as far as I understand it (alphabetical order?).

What if B and C each had a priority value and when rc has a choice between multiple packages to start it picks the one with the highest priority? Yea, this brings in complications concerning multi-level priorities, for example:

A: prio=1
B: prio=2, dep=A
C: prio=3, dep=A
D: prio=5, dep=B

initially only A can be started, so it's started, now we have a choice between B and C, C gets picked, then B and only then can D (which has a higher priority than anything else) be started. Arguably a better order may have been ABDC. This could have been achieved by automatically pushing down priorities based on dependencies. So B gets prio=5 since D (with prio=5) depends on it, and in the same manner A inherits 5. Which will then result in the ABDC ordering.

Is there something like this in gentoo land or do I just need to go and add a bunch of before ??? to my dhcpd startup script?
_________________
There are 10 kinds of people in the world,
those who understand binary and who don't
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum