public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Stefan Seyfried <seife@suse.de>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>,
	Petr Lautrbach <plautrba@redhat.com>,
	BlueZ development <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH] Add on demand functionality to bluetooth init script
Date: Fri, 5 Jun 2009 18:42:00 +0200	[thread overview]
Message-ID: <20090605164200.GB13177@suse.de> (raw)
In-Reply-To: <1244216906.23850.70.camel@localhost.localdomain>

On Fri, Jun 05, 2009 at 05:48:26PM +0200, Marcel Holtmann wrote:

> first of all the question from Stefan needs to be handled on how we
> handle the case for udev event before D-Bus system daemon is started.
> 
> Personally I think having an extra init script style for this makes no
> sense and just adds complexity in the start/stop process of the daemon.
> 
> I might prefer if we add special bluetoothd --udev={start,stop} handling
> to it (including polling code for D-Bus system daemon availability).

I actually solved it like this (no, I'm not proud of it, but it works):

* instead of calling "/etc/init.d/bluetooth condstart" from udev, I call
  a bluetooth.sh which basically does:

  mkdir /dev/shm/bluetooth-adapter-present # this is just a marker
  /bin/dbus-send --system --type=method_call --print-reply \
	--reply-timeout=1000 --dest=org.bluez / org.bluez.hello

  If D-Bus is already up (adapter hotplug), then the dbus-send activates
  bluetoothd via dbus-activation.

* I have a second, trivial init script which is always enabled and runs
  at the end of the boot process (after D-Bus start, that is) and which
  just does

  [ -x /dev/shm/bluetooth-adapter-present ] && \
	/etc/init.d/bluetooth start

  This handles the "adapter was plugged in before D-Bus was ready" case.

It's not particularly pretty, and I do not want to suggest that this is
a correct solution, but it solved the problem nicely for me.

Regards,

	Stefan
-- 
Stefan Seyfried
R&D Team Mobile Devices            |              "Any ideas, John?"
SUSE LINUX Products GmbH, Nürnberg | "Well, surrounding them's out." 

This footer brought to you by insane German lawmakers:
SUSE Linux Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

  reply	other threads:[~2009-06-05 16:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-04 14:52 [PATCH] Add on demand functionality to bluetooth init script Petr Lautrbach
2009-06-05 14:51 ` Stefan Seyfried
2009-06-08 11:31   ` Petr Lautrbach
2009-06-08 11:59     ` Stefan Seyfried
2009-06-08 12:17       ` Petr Lautrbach
2009-06-05 15:38 ` Johan Hedberg
2009-06-05 15:48   ` Marcel Holtmann
2009-06-05 16:42     ` Stefan Seyfried [this message]
2009-06-05 16:53       ` Stefan Seyfried

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090605164200.GB13177@suse.de \
    --to=seife@suse.de \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=plautrba@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox