set user id for service ?

Havoc Pennington hp at
Fri Sep 15 08:27:05 PDT 2006


If this is done in a thorough well-thought-out way with a helper then 
that makes sense to me as a feature. If the uid feature is only used 
with custom buses running as root, that's less worth spending time on.

Here's a big macro question for you. Have you read the "upstart" docs? I 
think to the extent dbus launches system daemons it overlaps with the 
primary purpose of upstart, and to the extent upstart sends increasingly 
complex events and works as an IPC system, it overlaps with the primary 
purpose of dbus. I have some fear that the result is a big mess where 
any given task can be done with either upstart or dbus, or worse 
distributions diverging on this point.

Before making the system daemon launch services it might be good to at 
least have a hypothesis on which system is used for what.

David Zeuthen wrote:
> Also, you probably don't want to pull in libdbus and I don't think you
> need it either given the simple interface.

To parse config files and launch stuff you do somewhat want DBusString 
and dbus-spawn.c (DBusString's purpose is to be more secure than a bunch 
of manual strcpy or file parsing code, and dbus-spawn.c is just hard to 
get right so cut-and-pasting it doesn't appeal too much). There's also 
the whole running-on-windows issue, if not using libdbus the helper 
would have its own special "sysdeps.h" portability stuff - anyway I 
think using the libdbus utility features probably makes things more 
maintainable. It doesn't look like the helper is quite trivial enough to 
be just a hundred lines of code, it's something of a little daemon in 
its own right.

My guess is that dbus itself should not be the IPC mechanism though, 
just create a pipe before forking the helper and use a trivial custom 

To keep only one codepath, the session daemon would also want to have a 
helper for launching stuff, I would think. In the session daemon case it 
could be a thread instead of a process maybe to save memory, but 
otherwise work the same. Even that divergence could be pointless though.


More information about the dbus mailing list