[PATCH] startkde and dbus-launch

Thiago Macieira thiago at kde.org
Sun Dec 27 22:36:23 GMT 2009


Em Domingo 27. Dezembro 2009, às 19.16.33, Jos van den Oever escreveu:
> You can at least remove the comment about autolaunch being broken,
> since it is not broken. The problem is that when the dbus daemon is
> not yet running (DBUS_SESSION_BUS_ADDRESS not set), each app trying to
> talk to the daemon will start a new daemon. 

No, they won't.

Each will start dbus-launch, which will find the running daemon.

> The current startkde.cmake
> aready handles this. I do not see how this patch improves this
> behavior. 'man dbus-launch' says about --autolaunch "This option is
> for the exclusive use of libdbus, you do not want to  use  it
> manually. It may change in the future." Also, what is the role of the
> MACHINEID? The man page does not explain it and since you set it, you
> might know. Shouldn't the line be:
>   eval `dbus-launch --sh-syntax --exit-with-session --autolaunch=$uuid`
> (note the =).

Well, look at this:

$ dbus-launch --sh-syntax --exit-with-session
DBUS_SESSION_BUS_ADDRESS='unix:abstract=/tmp/dbus-7SaKrv4ifS,guid=1b5ce3bd8aec7b9dc67c3b2f4b37e0c5';
export DBUS_SESSION_BUS_ADDRESS;
DBUS_SESSION_BUS_PID=2758;

$ dbus-launch --sh-syntax --exit-with-session
DBUS_SESSION_BUS_ADDRESS='unix:abstract=/tmp/dbus-
q383kGAl3L,guid=b21dce3a9df36c3cbbb0ebba4b37e0c5';
export DBUS_SESSION_BUS_ADDRESS;
DBUS_SESSION_BUS_PID=2763;

As you can see, two daemons were started.

With the extra argument:
$ dbus-launch --sh-syntax --exit-with-session --autolaunch `dbus-uuidgen --
get`
DBUS_SESSION_BUS_ADDRESS='unix:abstract=/tmp/dbus-4SpNn4Fbid,guid=57579523dbfa8abcff0e052f4b28ff68';
export DBUS_SESSION_BUS_ADDRESS;
DBUS_SESSION_BUS_PID=2549;
DBUS_SESSION_BUS_WINDOWID=4194305;

$ dbus-launch --sh-syntax --exit-with-session --autolaunch `dbus-uuidgen --
get`
DBUS_SESSION_BUS_ADDRESS='unix:abstract=/tmp/dbus-4SpNn4Fbid,guid=57579523dbfa8abcff0e052f4b28ff68';
export DBUS_SESSION_BUS_ADDRESS;
DBUS_SESSION_BUS_PID=2549;
DBUS_SESSION_BUS_WINDOWID=4194305;

As you can see now, the output is the same. It finds the already-launched D-Bus 
daemon.

The --autolaunch argument is what the library uses to find the already-running 
bus, or start one if none is running.

> The old version of the script fixed this and the new version prettifies
>  this

To tell you the truth, I don't see anything that needs fixing.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20091227/a4d87a14/attachment.sig>


More information about the kde-core-devel mailing list