autolaunch uuid support

Havoc Pennington hp at
Sun Oct 1 14:23:30 PDT 2006


I think there's still a little work to do here to orthogonalize 
dbus-launch so the code is easier to understand and the program is more 

Things it'd be nice to fix:
  - the normal session bus (from "dbus-launch --auto-syntax
    --exit-with-session" for example) should take the X selection
  - there should be options to force using an existing bus,
    or force never using an existing bus
  - you should be able to use an existing bus when a program
    to launch is specified
  - you should be able to read the existing bus without falling
    back to launching a bus

My thoughts on how to do this:

  - add --machine-id= for specifying machine id, and remove
    the argument from --autolaunch. If --machine-id is missing
    and we need the machine id, fork/exec dbus-uuidgen --get
    in order to obtain it.
    i.e. --machine-id is an optimization libdbus can use.
    But when not run by libdbus, dbus-launch can still get the
    machine id so it can do the X selection dance.

  - always take the X selection if nobody else has it

  - an implied option --use-existing means try to read an existing bus
    from in order 1) DBUS_SESSION_BUS_ADDRESS 2) the display
    and prefer these to launching a new bus. libdbus
    may need to unset DBUS_SESSION_BUS_ADDRESS before
    exec'ing dbus-launch.

  - an option --no-use-existing means don't try to read an
    existing bus from anywhere

  - the default is --use-existing for all modes so
    only --no-use-existing is an actual option

  - an implied option --launch means to start a bus if
    we did not read an existing one (since none existed,
    or --no-use-existing)

  - an option --no-launch means never start a bus if
    none is found

  - --launch is the default for all modes, so only
    --no-launch is an actual option

  - remove --autolaunch, have libdbus use:
      dbus-launch --binary-syntax           \
                  --machine-id=blahblah     \
    which implies --launch --use-existing.

  - much of the test suite should probably use --no-use-existing
    or unset/replace the session bus address if it doesn't

  - the current session-login code is usually
     eval `dbus-launch --auto-syntax     \
    or something like that. It behaves like (in the
    new proposal):
      dbus-launch --auto-syntax       \
                  --exit-with-session \
    plus it does not take the X selection.

    However, I'm suggesting that --use-existing become the
    default, and that the babysitter always takes the X
    selection if it's available; so those are two changes
    to the current session bus launch behavior.

  - the autolaunch: address could support flags that
    resulted in --no-launch or --no-use-existing
    being passed through



More information about the dbus mailing list