When stopping the bluetooth service, the stop() function checks which services are enabled in the configuration file /etc/conf.d/bluetooth, and stops those only. This creates a problem if the settings are changed since last time to avoid starting a given service (I hit the problem when restarting bluetooth after updating to the latest version from a previous 3.x version, and sdp switched from enabled to disabled, sdp wasn't stopped, nor started, so the previous one continue drunning). It also checks for presence of the executable file, which makes it impossible to stop the services after the package is uninstalled. The solutions for this are are two, one is to avoid checking at all, and simply stop everything every time, the other (IMHO nicer) is to split out the services in a series of init scripts, adding bluetooth as an init meta-script that, depending on the configured variables, depends on the various services; starting and stopping the daemons would then be possible without problems.
Created attachment 119087 [details] /etc/init.d/hcid
Created attachment 119089 [details] /etc/init.d/sdpd
Created attachment 119090 [details] /etc/init.d/pand
Created attachment 119092 [details] /etc/init.d/dund
Created attachment 119094 [details] /etc/init.d/rfcomm
Created attachment 119096 [details] /etc/init.d/hidd
Created attachment 119097 [details] /etc/conf.d/pand
Created attachment 119099 [details] /etc/conf.d/dund
Created attachment 119100 [details] /etc/conf.d/rfcomm
Created attachment 119102 [details] /etc/conf.d/hidd
Created attachment 119104 [details] /etc/conf.d/hcid
Diago, I totally agree. I've split up /usr/portage/net-wireless/bluez-utils/files/bluez-utils-2.25-init.d into seperate init scripts. Please review
(In reply to comment #12) > Diago, I totally agree. > > I've split up > /usr/portage/net-wireless/bluez-utils/files/bluez-utils-2.25-init.d into > seperate init scripts. Please review > We should work on this in an overlay for example. I can get you commit access to my dev overlay in overlays.gentoo.org if you want.
It came to me now that this only solves half the problem, as stop and restart of the meta-service wouldn't stop the other services, I'll see to talk with Roy, maybe there's a way to get that working too.
> I can get you commit access to my dev overlay in overlays.gentoo.org if you > want. That would be nice. > It came to me now that this only solves half the problem, as stop and restart > of the meta-service wouldn't stop the other services Hmm what do you mean? "/etc/init.d/hcid stop" also stops for example hidd.
(In reply to comment #15) > > I can get you commit access to my dev overlay in overlays.gentoo.org if you > > want. > That would be nice. > genstef informed me that I have access to Sunrise so we can use that for the time being.
Yeah but hotplug start/stop of the service might a bit tricky this way. If you don't think a bluetooth meta-script is needed, that works for me :) It was just to maintain the same behaviour as before, but it's probably worth changing behaviour at this point.
Okay committed to sunrise
Don't forget the metascript...
(In reply to comment #18) > Okay committed to sunrise > It seems our work was in vain: 13:44 < Betelgeuse> I am wondering why bluetooth.init doesn't start sdpd any more? 13:45 < holtmann> Not needed. It is part of hcid when you start it with -s. 13:45 < Betelgeuse> Ok I should change the Gentoo init script then 13:46 < Betelgeuse> http://viewcvs.gentoo.org/viewcvs.py/gentoo-x86/net-wireless/bluez-utils/files/bluez-utils-2.25-init.d?rev=1.1&view=markup 13:46 < Betelgeuse> holtmann: What about the others? 13:46 < holtmann> Actually with the new service implementation no other daemon than hcid is needed.
*bluez-utils-3.10.1 (16 May 2007) 16 May 2007; Petteri Räty <betelgeuse@gentoo.org> +files/bluez-utils-3.10.1-init.d, +files/bluez-utils-3.10.1-udev.rules, +files/bluez-utils-3.10.1-udev.script, +bluez-utils-3.10.1.ebuild: Version bump. A new simpler init script that uses the service architechture so we only need the hcid daemon. Disabled alsa, obex and sync support because upstream says they are not working yet. Added examples use flag to install the echo example service, old-daemons to install the old daemons and test-programs to install l2test and rctest programs. Made the udev helper use IN_HOTPLUG and fix starting the service via udev. Fixes bug #178268, #178210, #178160, #160273 and #144812. So this is fixed in 3.10.1 that only uses the hcid daemon.