Improving SysVinit

On Advogato, groom wrote:

System V’s init runs sequetially from 00foo to 99bar in each runlevel (1,2,3,4,5,6 in linux). And it is long. I wonder if it could be (yes it could) possible to extend init to handle 2 more types of daemons : xxFFbar (fire and forget) and xxPPfoo (Parallel in sequence xx). thus on SMP, unices could start faster by making such a fork..

I’ve been thinking about the clunky SysVinit orgnaization for a while, and I think the entire current scheme should be done away with. There should be one text file per service. That text file should list what runlevels the service is supposed to run in, and what other services it depends on (requires to be running first). Then init can just do a dependency analysis (ala make) to determine what order to start things in, what things can be started concurrently (make -j), and what order to shut things down in.

Only the top-level services desired in a run level would need to be explicitly enabled, and the services they depend on would be inferred. Though there could be a setting to explicitly prohibit a service from running in a particular runlevel, which would also prevent things depending on it from running in that runlevel.

I’ve been wanting to prototype this for quite a while, but I haven’t gotten a Round Toit yet.

This entry was posted in Linux. Bookmark the permalink.

Leave a Reply