/etc/rc and potential startup improvements

Shahms King shahms at shahms.com
Fri Feb 6 16:59:00 UTC 2004


Some of you may remember Seth Nickell talking about a replacement for
init called SystemServices.  When I first read about it I saw a few
problems with it.  First and foremost is developer buy-in.  In order for
it to be successful, it requires that the application developers
themselves provide a services API using that (potentially distribution
or Linux specific) interface.  That can be a significant barrier to
entry for an application that aims to be portable and providing startup
services are done so differently on so many platforms (some of which
will never adopt DBUS) that, in my opinion, makes it almost a
non-starter.  Additionally, I see nothing wrong with runlevels or most
of the current rc system.  The most glaring lack in the current system
is a specification of something more meaningful than a simple numeric
order.  The other solutions I've seen usually provide service
configuration and dependency information in a single, flat, file which
has the same problems as the BSD-style init scripts.

It should be possible to start programs which have no dependency on each
other in parallel. And it should be possible to remain
backwards-compatible with projects that haven't updated their
initscripts. And it should be possible to do this without changing the
current initscripts structure or "API".  Using FC1 as a base, and
chkconfig for ideas, I'm currently working on a small python-based "rc"
replacement that should be able to manage all of that with a small
addition to the headers already present at the top of an initscript.

By adding a 'depends:' line to the top of an initscript, it should be
possible to create a backwards-compatible system (installed side-by-side
with the current bash-based one) with a few extra "smarts" that can
ensure all services with explicit dependency information have their
dependencies started before they are and all services without the
'depends:' header started after all services with a lower number. 
Installing the python 'rc.py' and helper 'rc-helper' shell script (for
initscripts that don't use action, killproc, daemon, etc.) will allow
the bash-based rc script to be used in the absence of a python binary. 
Given that the goal is to write the rc.py in such a way as to use the
current runlevel information as a "guide" to dependency information only
overriding those dependencies where explicitly specified it should be
possible to gain a small measure of parallel-startup without changing
the headers at all (any services with the same number after the 'S' have
a non-deterministic order -- well,it's lexicographic, but the 'rules' of
rc say that only the numeric value counts -- and so cannot depend on
each other and may be started in parallel).

Of course, there are certain situations that will negatively impact this
proposal. Some services sometimes require the network to be up and
sometimes don't, most databases fall into this category, X terminals,
etc.

At the moment I have it working well enough to start programs in the
specified order (whooo ;-P) essentially a python port of the rc file,
actually adding some dependency information to my initscripts is the
next step, I'm just posting to ask the question: would anyone be
interested in this purely-optional add-on if I manage to get it working
to my satisfaction?  Are there other people out there working on another
solution to the initscript problem?

-- 
Shahms King <shahms at shahms.com>





More information about the fedora-devel-list mailing list