Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 178210 - net-wireless/bluez-utils-3.10: init script stops only services enabled to start
Summary: net-wireless/bluez-utils-3.10: init script stops only services enabled to start
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Petteri Räty (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-12 15:02 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2007-05-16 12:46 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/etc/init.d/hcid (hcid,1.19 KB, text/plain)
2007-05-13 09:49 UTC, Dick Marinus
Details
/etc/init.d/sdpd (sdpd,368 bytes, text/plain)
2007-05-13 09:49 UTC, Dick Marinus
Details
/etc/init.d/pand (pand,501 bytes, text/plain)
2007-05-13 09:50 UTC, Dick Marinus
Details
/etc/init.d/dund (dund,501 bytes, text/plain)
2007-05-13 09:50 UTC, Dick Marinus
Details
/etc/init.d/rfcomm (rfcomm,488 bytes, text/plain)
2007-05-13 09:50 UTC, Dick Marinus
Details
/etc/init.d/hidd (hidd,414 bytes, text/plain)
2007-05-13 09:51 UTC, Dick Marinus
Details
/etc/conf.d/pand (pand,86 bytes, text/plain)
2007-05-13 09:53 UTC, Dick Marinus
Details
/etc/conf.d/dund (dund,86 bytes, text/plain)
2007-05-13 09:54 UTC, Dick Marinus
Details
/etc/conf.d/rfcomm (rfcomm,100 bytes, text/plain)
2007-05-13 09:54 UTC, Dick Marinus
Details
/etc/conf.d/hidd (hidd,77 bytes, text/plain)
2007-05-13 09:54 UTC, Dick Marinus
Details
/etc/conf.d/hcid (hcid,169 bytes, text/plain)
2007-05-13 09:55 UTC, Dick Marinus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2007-05-12 15:02:32 UTC
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.
Comment 1 Dick Marinus 2007-05-13 09:49:38 UTC
Created attachment 119087 [details]
/etc/init.d/hcid
Comment 2 Dick Marinus 2007-05-13 09:49:55 UTC
Created attachment 119089 [details]
/etc/init.d/sdpd
Comment 3 Dick Marinus 2007-05-13 09:50:12 UTC
Created attachment 119090 [details]
/etc/init.d/pand
Comment 4 Dick Marinus 2007-05-13 09:50:33 UTC
Created attachment 119092 [details]
/etc/init.d/dund
Comment 5 Dick Marinus 2007-05-13 09:50:55 UTC
Created attachment 119094 [details]
/etc/init.d/rfcomm
Comment 6 Dick Marinus 2007-05-13 09:51:18 UTC
Created attachment 119096 [details]
/etc/init.d/hidd
Comment 7 Dick Marinus 2007-05-13 09:53:48 UTC
Created attachment 119097 [details]
/etc/conf.d/pand
Comment 8 Dick Marinus 2007-05-13 09:54:04 UTC
Created attachment 119099 [details]
/etc/conf.d/dund
Comment 9 Dick Marinus 2007-05-13 09:54:26 UTC
Created attachment 119100 [details]
/etc/conf.d/rfcomm
Comment 10 Dick Marinus 2007-05-13 09:54:44 UTC
Created attachment 119102 [details]
/etc/conf.d/hidd
Comment 11 Dick Marinus 2007-05-13 09:55:05 UTC
Created attachment 119104 [details]
/etc/conf.d/hcid
Comment 12 Dick Marinus 2007-05-13 09:56:05 UTC
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
Comment 13 Petteri Räty (RETIRED) gentoo-dev 2007-05-13 14:39:59 UTC
(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.
Comment 14 Diego Elio Pettenò (RETIRED) gentoo-dev 2007-05-13 14:50:29 UTC
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.
Comment 15 Dick Marinus 2007-05-13 15:07:19 UTC
> 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.
Comment 16 Petteri Räty (RETIRED) gentoo-dev 2007-05-13 15:17:15 UTC
(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.
Comment 17 Diego Elio Pettenò (RETIRED) gentoo-dev 2007-05-13 15:18:36 UTC
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.
Comment 18 Dick Marinus 2007-05-13 17:35:57 UTC
Okay committed to sunrise
Comment 19 Chris Carlin 2007-05-13 18:49:22 UTC
Don't forget the metascript...
Comment 20 Petteri Räty (RETIRED) gentoo-dev 2007-05-16 10:47:17 UTC
(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.
Comment 21 Petteri Räty (RETIRED) gentoo-dev 2007-05-16 12:46:08 UTC
*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.