[patch] Auto session bus launch from libdbus

Lennart Poettering mzqohf at 0pointer.de
Sun Sep 10 15:10:53 PDT 2006

On Sun, 10.09.06 23:42, Thiago Macieira (thiago at kde.org) wrote:

> Worthy of note:
> * instead of saving the data in the X11 root window as an atom, I 
> preferred to save it in a file. The advantage is that this allows 
> libdbus-1 to determine the server address without having to fork(2).

But detaches the dbus session from the X11 session, because it
requires that networked clients share a single NFS home directory.

> * this code is used only in X11 and only if $DISPLAY is set. It is not 
> meant to start the D-Bus session daemon from the console/CLI. However, it 
> is my intention to access launchd parameters inside MacOS X; on Windows, 
> whatever is appropriate should be used too.

Wouldn't it make sense to use what ttyname(2) returns (2 is a
parameter in this case, not the man page section) as session
identifier when $DISPLAY is not set? This would allow simple DBUS
support even for text terminal sessions.

> * I have no idea if flock(2) is portable to the other Unix platforms or if 
> it's enough to guarantee exclusive access on NFS mounts. Someone with 
> better knowledge, please come forward.

flock() is BSD legacy. On modern systems everyone should use
fcntl(F_SETLK). It's POSIX and the only way to lock files safely over

Lennart Poettering; lennart [at] poettering [dot] net
ICQ# 11060553; GPG 0x1A015CC4; http://0pointer.net/lennart/

More information about the dbus mailing list