Skip to contentSkip to conversation

hcid hotplug initialisation?

Bluez-devel Fredrik Noring 2 participants 8 messages Feb 9, 2004 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi

Regarding hcid initilisation, what about having the hotplug stuff starting hcid instead of /etc/init.d/hcid?

That way hcid can be installed without using cpu/memory resources and it will work automatically when a user inserts some Bluetooth device.

Fredrik

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#1 lore raw

Hi Fredrik,

Quoted 6 lines

Regarding hcid initilisation, what about having the hotplug stuff starting hcid instead of /etc/init.d/hcid?

That way hcid can be installed without using cpu/memory resources and it will work automatically when a user inserts some Bluetooth device.

no. The bluetooth.agent is only for device specific configuration and not for starting a deamon. However hcid watches all interfaces and bluetooth.agent would be called for every device. Multiple running hcid's will mess up the security manager.

Regards

Marcel

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#2 lore raw

mån 2004-02-09 klockan 11.47 skrev Marcel Holtmann:

Quoted 3 lines

no. The bluetooth.agent is only for device specific configuration and not for starting a deamon. However hcid watches all interfaces and bluetooth.agent would be called for every device.

Having hcid actively running on a system that never will use a Bluetooth device is waste of resources. But when a user inserts a Bluetooth device, it would be excellent to have it all work automtically. What do you suggest then?

Quoted 1 line

Multiple running hcid's will mess up the security manager.

Yes, but only one hcid instance would run. The hotplug script and/or hcid can check this.

Fredrik

maintainer
#3 lore raw

Hi Fredrik,

Quoted 8 lines
Quoted 3 lines

no. The bluetooth.agent is only for device specific configuration and not for starting a deamon. However hcid watches all interfaces and bluetooth.agent would be called for every device.

Having hcid actively running on a system that never will use a Bluetooth device is waste of resources. But when a user inserts a Bluetooth device, it would be excellent to have it all work automtically. What do you suggest then?

but you expect that the user has installed the Bluetooth specific software? If the software is installed we start all needed parts of the Bluetooth subsystem. If they don't want them they shouldn't install their software.

To make everything work perfect on the first use of a Bluetooth dongle is not the job of the Bluetooth subsystem. If the USB or PCMCIA subsytem detects a Bluetooth device it has to install, start or run whatever other action is needed to make it work.

Quoted 4 lines
Quoted 1 line

Multiple running hcid's will mess up the security manager.

Yes, but only one hcid instance would run. The hotplug script and/or hcid can check this.

If hcid is not running, because no device is attached. How would you manage you pairings through D-Bus for example? For some stuff an attached device is not needed.

If you think the long way then after hcid comes sdpd. This daemon must be started first, before any PAN service can be started. Starting all daemons from bluetooth.agent is stupid, because none of them actually are bound to a specific device. And people also reported that starting daemons from bluetooth.agent causes troubles.

Regards

Marcel

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#4 lore raw

Marcel,

mån 2004-02-09 klockan 12.20 skrev Marcel Holtmann:

Quoted 2 lines

but you expect that the user has installed the Bluetooth specific software?

Yes, it could be installed by default. A few megs of harddisk space is hardly an issue compared with having a handful of strange daemons (hcid, stpd etc.) always running no matter if any Bluetooth devices are actually available or not, is it?

Quoted 3 lines

If the software is installed we start all needed parts of the Bluetooth subsystem. If they don't want them they shouldn't install their software.

Starting these services on demand is more efficient and simpler for the user. Perhaps 1 % of all users will try to use the Bluetooth stuff.

Quoted 4 lines

To make everything work perfect on the first use of a Bluetooth dongle is not the job of the Bluetooth subsystem. If the USB or PCMCIA subsytem detects a Bluetooth device it has to install, start or run whatever other action is needed to make it work.

This would require that hcid is compatible with that approach. That's the issue here. :)

Quoted 3 lines

If hcid is not running, because no device is attached. How would you manage you pairings through D-Bus for example? For some stuff an attached device is not needed.

The hotplug may not be the only way to start hcid. Other services may require it to start too, of course.

Quoted 2 lines

If you think the long way then after hcid comes sdpd. This daemon must be started first, before any PAN service can be started.

This kind of dependency needs to be tracked too.

Fredrik

maintainer
#5 lore raw

Hi Fredrik,

Quoted 7 lines
Quoted 2 lines

but you expect that the user has installed the Bluetooth specific software?

Yes, it could be installed by default. A few megs of harddisk space is hardly an issue compared with having a handful of strange daemons (hcid, stpd etc.) always running no matter if any Bluetooth devices are actually available or not, is it?

the daemons are idle if no device is attached. So who cares? If they are installed and should not be started, we can use /etc/default/bluetooth for these kind of settings.

Quoted 6 lines
Quoted 3 lines

If the software is installed we start all needed parts of the Bluetooth subsystem. If they don't want them they shouldn't install their software.

Starting these services on demand is more efficient and simpler for the user. Perhaps 1 % of all users will try to use the Bluetooth stuff.

If they don't use Bluetooth, they don't even install it and so no problem. However it is _not_ efficient to start a whole subsystem with all its daemons from a hotplug script. Everyone who likes this approch can do it of course, but I will never accept this as default.

Quoted 7 lines
Quoted 4 lines

To make everything work perfect on the first use of a Bluetooth dongle is not the job of the Bluetooth subsystem. If the USB or PCMCIA subsytem detects a Bluetooth device it has to install, start or run whatever other action is needed to make it work.

This would require that hcid is compatible with that approach. That's the issue here. :)

No. This requires that the USB and PCMCIA subsystem knows what devices are Bluetooth devices. If not installed they have to install the BlueZ packages that are needed and then they have to run the init script.

Quoted 6 lines
Quoted 3 lines

If hcid is not running, because no device is attached. How would you manage you pairings through D-Bus for example? For some stuff an attached device is not needed.

The hotplug may not be the only way to start hcid. Other services may require it to start too, of course.

Two places where we have to start a daemon? Too complex. Start it at init.

Quoted 4 lines
Quoted 2 lines

If you think the long way then after hcid comes sdpd. This daemon must be started first, before any PAN service can be started.

This kind of dependency needs to be tracked too.

I don't wanna track this down. Start hcid and sdpd and then everything else you want. Starting them from init is the best way.

Regards

Marcel

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#6 lore raw

Marcel,

mån 2004-02-09 klockan 13.50 skrev Marcel Holtmann:

Quoted 1 line

the daemons are idle if no device is attached. So who cares?

System start is slower. Process list is cluttered. Memory is wasted. These are the main issues.

Quoted 2 lines

If they don't use Bluetooth, they don't even install it and so no problem.

Can I ask you: Do you use each and every single application you have installed on your system? :)

Quoted 2 lines

Two places where we have to start a daemon? Too complex. Start it at init.

If the hotplug scripts somehow could talk to init, that'll work I suppose?

Fredrik

maintainer
#7 lore raw

Hi Fredrik,

Quoted 4 lines
Quoted 1 line

the daemons are idle if no device is attached. So who cares?

System start is slower. Process list is cluttered. Memory is wasted. These are the main issues.

and starting from bluetooth.agent makes the agent script slower. It can introduce race conditions.

If people plan to install Bluetooth, but don't plan to use it, we can have a /etc/default/bluetooth option for deactivating hcid and co at startup.

Quoted 5 lines
Quoted 2 lines

If they don't use Bluetooth, they don't even install it and so no problem.

Can I ask you: Do you use each and every single application you have installed on your system? :)

You won't believe it, but on my productiv systems I try to only have applications installed that I or the system itself uses. I believe in the way, that a minimal system is enough and if I need some other software I install them. The Debian way with apt-get is the best I've ever seen. I manage some system that I haven't reinstalled for over 5 years and they are as clean as I setup them.

However the bad guy is my development system, because I need hundreds of development packages, extra tools etc. ;)

Regards

Marcel

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel