Gentoo + Upstart

Sean E. Russell upstart at ser1.net
Wed Oct 18 03:57:24 BST 2006


Hey,

One of the reasons I've been harping on multi-event dependencies in Upstart is 
because I'm writing a script that reads Gentoo init scripts and evaluates a 
given configuration, and then writes such a compatability layer.  It 
currently works, as much as it can given the current Upstart feature list; 
which is to say, it doesn't yet build a bootable system, but it does generate 
a bunch of events from a given Gentoo installation.  As soon as I have 
multi-event dependencies, I should be able to reproduce a basic Gentoo init 
process.

At the moment, I'm begining to suspect that a "compatability layer" won't be 
sufficient, since I'm not sure how Gentoo's init scripts will behave in a 
foreign init environment, but we'll see.  It shouldn't matter, in the long 
run, because my script will just harvest what it needs and build the event 
scripts from the functions in the init scripts.  I'm optimistic, in any case.

It has raised a question (well, several related questions) about SOP for 
Upstart systems.

On sysvinit, you symlink init scripts into the rc.? directories as S and K 
scripts.  On Gentoo, you use 'rc-update add|del' to add and remove init 
scripts, and Gentoo handles resolving dependencies to insert the script into 
the init sequence in the appropriate place. In Upstart, you place event 
scripts into /etc/event.d, and if the appropriate events are generated, the 
scripts will be run.  To disable scripts, they are removed from /etc/event.d.

0) When a service is disabled, where should the event script be moved to?  
Removing it entirely is not a good idea... it can't be easily re-enabled.

1) When a package manager installs a package, where should it put the event 
script?  On Gentoo, the default behavior when a service is installed is NOT 
to automatically enable it.  If you install CUPS, you must 
additionally "rc-update add" it to get it to start.  To replicate this 
policy, there should be an intermediate place for (disabled) event scripts to 
live, and it woludn't be a terrible thing to have an Upstart script that 
moves event scripts between the /etc/event.d and <disabled> directories -- 
something that implements the functionality of "rc-update" and 
Redhat's "service".  

Any convenience scripts are secondary, and can be added later; the important 
part, I think, is the policy decision about where disabled Upstart scripts 
should live.

-- 
### SER   
### Deutsch|Esperanto|Francaise|Linux|XML|Java|Ruby|Aikido|Iaido
### http://www.ser1.net  jabber.com:ser  ICQ:83578737 
### GPG: http://www.ser1.net/Security/ser_public.gpg

-- 
### SER   
### Deutsch|Esperanto|Francaise|Linux|XML|Java|Ruby|Aikido|Iaido
### http://www.ser1.net  jabber.com:ser  ICQ:83578737 
### GPG: http://www.ser1.net/Security/ser_public.gpg



More information about the Upstart-devel mailing list