Off-topic: D-Bus in the kernel
Rémi Denis-Courmont
remi at remlab.net
Fri Sep 17 20:56:55 PDT 2010
Hello,
On Saturday 18 September 2010, Marcel Holtmann wrote:
> Hi Remi,
>
> > > > > So I could test a full GNOME session (and also N900) with AF_DBUS
> > > > > without implementing the bus driver in the kernel.
> > > >
> > > > So this puts the session bus in the kernel?
> > >
> > > It depends what is in /etc/dbus-1/{session,system}.conf. If there is:
> > > <listen>unix:tmpdir=/tmp</listen>
> > >
> > > it uses the usual AF_UNIX sockets. If I change it to:
> > > <listen>dbus:path=/tmp/kdbus</listen>
> > >
> > > then it use AF_DBUS sockets with kdbus.
> >
> > I expect such an abomination to be burnt in flames on the kernel mailing
> > list. There is no file "type" for DBus bus, so you simply cannot use the
> > file system for this - only Unix/local domain sockets are allowed to sit
> > there. Anything else will break stat() semantics, in my understanding.
>
> correct. Using path= is wrong. The sockaddr_dbus struct should be
> properly defined. Essentially just some like type=session and uuid=...
> or something should be enough.
>
> > You should really consider using something else for the sockaddr. It can
> > be as simple as an unique integer automatically assigned when listen()
> > gets called, fetched with getsockname(). As an added bonus, it becomes
> > trivial to start DBus early in the boot.
>
> Actually the kernel should just start the system bus. No reason to wait
> for userspace. That way we can remove all needed magic handling in init
> daemons like systemd. The D-Bus system bus is just present and always
> present as long as the kernel is running.
That would assume the kernel can handle everything that you'd expect from the
bus. I doubt that's going to happen. For a start, DBus activation cannot be
done from the kernel alone, just like modprobe.
Maybe the init process should spawn the bus, and I would hardly be surprised
if systemd did, but that's a different discussion.
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the dbus
mailing list