graeme at openmoko.org
Fri Oct 26 12:54:54 CEST 2007
I have spent some time investigation upstart and how it differs from
sysvinit which we currently use and these are my finding based on
documentation and looking at my ubuntu install.
1) How it knows what to run.
Sysvinit uses number files within /etc/rc?.d to decide the order that
services start. So this is a strict ordering that has no knowledge of
what services actually need before that startup.
Upstart has a tree of dependencies as each service says in needs X
started before it can start. It doesnt yet support parellel starting of
services but this is planned in the future.
2) What form do service scripts take.
Sysvinit has the classic start/stop/restart sh shell script. normally
with some functions at the top that take care of making sure the system
is configured correctly to run the service.
Upstart has a pre-start script, a line that tells how to manage the
service and a post-stop script. These scripts are pretty much identicle
to what you find in most functions in sysvinit scripts.
3) What problems do the system have for embedded systems.
The bigest problem I find with both systems is they have a tendancy
to do things like
BLAH = "cat /blah/blah | grep | awk"
PS = "ps | grep | awk"
Which is a whole lot of forking and loading off slow flash that it would
be nice to do without. A lot of times this would be nicely solved by a
pidof() or filecontains() type calls which if they could be done
without invoking shell would improve things greatly.
These scripts also tend to break when someone switches from busybox to
real version of tool as busybox doesnt follow the same arguments.
4) What do we do from here
I think upstart shows promise if we want to clean up the whole init
system as it lends itself better to some form of auto generation of
scripts within OE. Also as its still under development maybe there is
some manner to add the common function that are needed without invoking
sh half a dozen time to execute them.
Also when upstart gains parellel starting capability I think this will
allow use to get to X much earlier in the boot process. Showing people
the prettiness of the GUI much earlier than in sysvinit. Services can
then still be starting in the background. Im not sure this is what we
want but its a possibity.
Anyway this mail is to kick off any discussion on what we want to do,
do people want me to go further with upstart, or investigate other
More information about the distro-devel