Plymouth/Upstart integration

Colin Watson cjwatson at ubuntu.com
Sun Nov 14 07:23:25 PST 2010


I've been working on solving the problem whereby users of Ubuntu server
systems (in particular) get no indication that Upstart jobs are
starting.  Following suggestions from Scott James Remnant and Ray
Strode, I've written a plymouth-upstart-bridge process which connects to
Upstart's D-Bus interface and provides updates to Plymouth as events
change state.  Here's a preliminary patch for review.

This patch depends on
https://code.launchpad.net/~cjwatson/upstart/state-changed and
https://code.launchpad.net/~cjwatson/upstart/goal-changed, which add a
few more features to Upstart's D-Bus interface.

A working Upstart job for this bridge process looks something like this:

  # plymouth-upstart-bridge - Bridge Upstart state changes into Plymouth
  #
  # This helper process receives Upstart state changes over D-Bus and sends
  # corresponding messages to Plymouth.
  
  description     "Bridge Upstart state changes into Plymouth"
  
  start on (started dbus
            or runlevel [06])
  stop on stopping plymouth
  
  console output
  
  exec plymouth-upstart-bridge

(Ideally this would have 'start on (started plymouth and started dbus)',
but since the plymouth job is often started in the initramfs and
imported into Upstart's view of the world by means of a gross hack, that
won't work properly until Upstart grows the concept of states.)

Known flaws, which may or may not be critical:

  * This still crashes now and again for me, and the output is a bit
    messy because it tends to overlap with 'console output' jobs that
    write their own progress messages.

  * This only tells you when a job has started rather than letting you
    know when it's starting, which isn't ideal because you can't see
    what the boot process is currently hung up on, but doing otherwise
    without crazily confusing overlapping messages requires something a
    good deal more sophisticated than just writing to the console.

  * The bridge process has some distribution-specific policy in it (the
    console output format).  Maybe folks can just patch this as
    necessary; I'm not sure.

  * I think probably plymouth-upstart-bridge ought to link against
    libdbus directly rather than having libply.la do so.

  * Since I had to use the low-level libdbus, the code is much longer
    than I'd have liked.

Still, I think this is far enough along to ask for review.  Comments?

Thanks,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plymouth-upstart.patch
Type: text/x-diff
Size: 52852 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/plymouth/attachments/20101114/73f33068/attachment-0001.patch>


More information about the plymouth mailing list