Re: [Bluez-devel] Should hcid wait for dbus daemon?

Marcel Holtmann
2007-01-15T13:30:26Z

Hi Daniel,

> the hcid daemon aborts when there is no dbus daemon running. What about
> enhancing hcid to handle the case that the dbus daemon get started after
> hcid. I know there are might be not many use cases. But at least i know one
> case ;)
>
> To avoid that there is another "unneeded" service running, i want to call only
> the bluetooth init scripts when there is a bluetooth device plugged in. This
> is done by a simple udev rule, which calls the bluetooth init script when the
> device got plugged in.
>
> So there is no need to insserv or do any other stuff like running YaST or
> something like that. Just turn on the bluetooth device or plug it in and the
> bluetooth service get started by udev.
>
> The only problem is during boot. udev get started before the dbus daemon, and
> will trigger the udev rule which calls the bluetooth init script. Then hcid
> will fail because the dbus daemon isn't started in this early stage of boot.
>
> If the hcid would wait for the dbus daemon this wouldn't be a problem. At
> least hcid can handle a dbus daemon restart, maybe we can enhance this.
>
> I know this can be also done in the bluetooth init script, but maybe someone
> else insist on this enhancement.

I don't think that it is a good idea to have udev start daemons. My
understanding is that udev is for creating device nodes or init
hardware. In case of BlueZ it must start a number of daemons to have a
fully working Bluetooth setup. This task is better done by systems like
upstart which handle dependencies.

Regards

Marcel