2009-07-20 03:36:45

by Justin P. Mattock

[permalink] [raw]
Subject: bluetooth works with udev-145 but had some weired issues with it

For some reason in rules.d
for the permission setting:

#ACTION=="add", SUBSYSTEM=="bluetooth", RUN+="/usr/sbin/bluetoothd --udev"
to
RUN+="/usr/sbin/bluetoothd --udev"
gets this working for me.
prior to this, udev just would not activate
bluetoothd
Anyways thought it would be good to let people know.

--
Justin P. Mattock


2009-07-21 02:48:40

by Justin P. Mattock

[permalink] [raw]
Subject: Re: bluetooth works with udev-145 but had some weired issues with it

Mario Limonciello wrote:
> Hi Justin:
>
> Justin Mattock wrote:
>
>> For some reason in rules.d
>> for the permission setting:
>>
>> #ACTION=="add", SUBSYSTEM=="bluetooth", RUN+="/usr/sbin/bluetoothd --udev"
>> to
>> RUN+="/usr/sbin/bluetoothd --udev"
>> gets this working for me.
>> prior to this, udev just would not activate
>> bluetoothd
>> Anyways thought it would be good to let people know.
>>
>>
>>
> I'm wondering if you are seeing something similar that was happening on
> Ubuntu when getting bluez-4.45 added in where the daemon failed to start
> upon bootup but works fine later (eg if you hotplug the device).
>
> It turned out that dbus wasn't up and running at the time udev triggered
> all devices early in the boot.
>
> The easiest solution was to run:
>
> udevadm trigger --subsystem-match=bluetooth
>
>
> later on, during an init script or similar.
>
Don't mean to be latent on the response.
Anyways I tried adding

udevadm trigger --subsystem-match=bluetooth

to init.d/udev but the system fails hard(livecd to recover),
but adding the same entry to another init script after udev
has done its job results in a successful activation.

So I think it's safe to safe this is the same issue ubuntu was having.

Justin P. Mattock


2009-07-20 16:52:04

by Justin P. Mattock

[permalink] [raw]
Subject: Re: bluetooth works with udev-145 but had some weired issues with it

Mario Limonciello wrote:
> Hi Justin:
>
> Justin Mattock wrote:
>
>> For some reason in rules.d
>> for the permission setting:
>>
>> #ACTION=="add", SUBSYSTEM=="bluetooth", RUN+="/usr/sbin/bluetoothd --udev"
>> to
>> RUN+="/usr/sbin/bluetoothd --udev"
>> gets this working for me.
>> prior to this, udev just would not activate
>> bluetoothd
>> Anyways thought it would be good to let people know.
>>
>>
>>
> I'm wondering if you are seeing something similar that was happening on
> Ubuntu when getting bluez-4.45 added in where the daemon failed to start
> upon bootup but works fine later (eg if you hotplug the device).
>
> It turned out that dbus wasn't up and running at the time udev triggered
> all devices early in the boot.
>
> The easiest solution was to run:
>
> udevadm trigger --subsystem-match=bluetooth
>
>
> later on, during an init script or similar.
>
yeah, the:

ACTION=="add", SUBSYSTEM=="bluetooth", RUN+="/usr/sbin/bluetoothd --udev"
option gave no response after rebooting numerous times, until commenting out
ACTION, and SUBSYSTEM, and just using RUN+=
The init script has /sbin/udevadm trigger and /sbin/udevadm settle
after /sbin/udevd --daemon is called.
And from what I see that might be whats happening,
udevadm needs to be told about the subsystem call.

I'll go ahead and try your solution and see if it reads the susbsystem
option without having to change the *.rules

Justin P. Mattock



2009-07-20 16:44:25

by Kay Sievers

[permalink] [raw]
Subject: Re: bluetooth works with udev-145 but had some weired issues with it

On Mon, Jul 20, 2009 at 09:14, Marcel Holtmann<[email protected]> wrote:
>> For some reason in rules.d
>> for the permission setting:
>>
>> #ACTION=="add", SUBSYSTEM=="bluetooth", RUN+="/usr/sbin/bluetoothd --udev"
>> to
>> RUN+="/usr/sbin/bluetoothd --udev"
>> gets this working for me.
>> prior to this, udev just would not activate
>> bluetoothd
>> Anyways thought it would be good to let people know.
>
> this is pretty much strange. What kernel version are you using?
>
> Kay, do you have any idea why such a simple rule would not work?

No, no idea. It works fine here to start bluetoothd from udev.

Kay

2009-07-20 15:31:43

by Mario Limonciello

[permalink] [raw]
Subject: Re: bluetooth works with udev-145 but had some weired issues with it

Hi Justin:

Justin Mattock wrote:
> For some reason in rules.d
> for the permission setting:
>
> #ACTION=="add", SUBSYSTEM=="bluetooth", RUN+="/usr/sbin/bluetoothd --udev"
> to
> RUN+="/usr/sbin/bluetoothd --udev"
> gets this working for me.
> prior to this, udev just would not activate
> bluetoothd
> Anyways thought it would be good to let people know.
>
>
I'm wondering if you are seeing something similar that was happening on
Ubuntu when getting bluez-4.45 added in where the daemon failed to start
upon bootup but works fine later (eg if you hotplug the device).

It turned out that dbus wasn't up and running at the time udev triggered
all devices early in the boot.

The easiest solution was to run:

udevadm trigger --subsystem-match=bluetooth


later on, during an init script or similar.
--
Mario Limonciello
*Dell | Linux Engineering*
[email protected]


Attachments:
signature.asc (260.00 B)
OpenPGP digital signature

2009-07-20 07:41:14

by Justin P. Mattock

[permalink] [raw]
Subject: Re: bluetooth works with udev-145 but had some weired issues with it

Marcel Holtmann wrote:
> Hi Justin,
>
>
>> For some reason in rules.d
>> for the permission setting:
>>
>> #ACTION=="add", SUBSYSTEM=="bluetooth", RUN+="/usr/sbin/bluetoothd --udev"
>> to
>> RUN+="/usr/sbin/bluetoothd --udev"
>> gets this working for me.
>> prior to this, udev just would not activate
>> bluetoothd
>> Anyways thought it would be good to let people know.
>>
>
> this is pretty much strange. What kernel version are you using?
>
> Kay, do you have any idea why such a simple rule would not work?
>
> Regards
>
> Marcel
>
>
>
>
kernel is the latest git from linus pulled a day ago.
The system itself is a home brewed LFS.

As for the simple rule, this one has me confused as well.
unless I did something wrong while compiling bluez/udev
(missed a switch) or something is missing in the system itself
to not read ADD or SUBSYSTEM.
Looking at the init script for udev I cant see how it could cause
udev to not read that specific rule unless:

cat /etc/rc.d/init.d/udev
(this is taken towards the bottom)

/sbin/udevd --daemon

# Now traverse /sys in order to "coldplug" devices that
have
# already been discovered
/sbin/udevadm trigger

# Now wait for udevd to process the uevents we triggered
/sbin/udevadm settle
evaluate_retval


udevadm might have created confusion.
Also keep in mind the system is not running hal.
(not sure how depended bluez/udev is with hal)
This one has me stumped.

but besides that confusion everything seems to be handling pretty good
(nice work on the bluetooth bluez!!)
I like how the scrollball for the mouse survives suspend.

Justin P. Mattock

2009-07-20 07:14:23

by Marcel Holtmann

[permalink] [raw]
Subject: Re: bluetooth works with udev-145 but had some weired issues with it

Hi Justin,

> For some reason in rules.d
> for the permission setting:
>
> #ACTION=="add", SUBSYSTEM=="bluetooth", RUN+="/usr/sbin/bluetoothd --udev"
> to
> RUN+="/usr/sbin/bluetoothd --udev"
> gets this working for me.
> prior to this, udev just would not activate
> bluetoothd
> Anyways thought it would be good to let people know.

this is pretty much strange. What kernel version are you using?

Kay, do you have any idea why such a simple rule would not work?

Regards

Marcel