== Problem: Startup == #1988 Rainbow needs to be started before the first activity is started, so that it can be ready to go when Sugar starts launching activities. Presently: The startup sequence looks something like: 1. `/etc/inittab' specifies that the default runlevel is 5. 2. Upon entering runlevel 5, the DBus system daemon is started with priority 22. 3. `/etc/inittab' specifies that `/sbin/olpc-dm' should be started on runlevel 5. 4. `/sbin/olpc-dm' does some basic configuration of the terminal, language environment, and the session (e.g. does a PAM login); then it logs in as user `olpc' and runs `startx'. 5. `startx' runs `xinit' which reads through /home/olpc/.xinitrc, does some further graphical configuration, and then exec's `sugar'. 6. `sugar' is a script that uses `dbus-launch' to start the DBus session daemon. 7. The session daemon, once started, runs its argument `sugar-shell' with appropriate environment variables. 8. `sugar-shell' brings up Sugar. NB: Blizzard suggests that the current startup is hackish and should be changed. * In particular, we should use something less vulnerable to modification than .xinitrc to start up. * Also, he said that rc-scripts are going away to be replaced by a monolithic start script. Plan: In the first iteration, we will simply launch Rainbow via rc-script at a higher priority than `messagebus'. Since `sugar-shell' presently records its DBus session bus's address to a `session.info' file, we will simply read this file to acquire access to the main DBus session bus. Followup: Ivan suggests that we use `init' to start and respawn Rainbow. "Creating an Unkillable Process", Silas Brown, Linux Gazette #139, 2007 http://linuxgazette.net/139/brownss.html gives a nice overview of how to do this in a hardened way. In the longer term, we may want to make the session bus talk to Rainbow in some other fashion, for example by enclosing `sugar-shell' in a security stub or by bringing the session bus up entirely separately from X.