linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Pitt <martin.pitt@ubuntu.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] systemd: Check if bluetooth is supported in the kernel
Date: Tue, 20 Oct 2015 16:10:55 +0200	[thread overview]
Message-ID: <20151020141055.GA2657@piware.de> (raw)
In-Reply-To: <3C809C59-9F50-40AC-B55D-C5456B333183@holtmann.org>

Hey Marcel,

Marcel Holtmann [2015-10-20 15:19 +0200]:
> > +ConditionPathIsDirectory=/sys/class/bluetooth
> 
> and this is not a race condition? I mean that directory might be not
> present because the module has not yet been loaded. So strictly
> speaking the kernel has been compiled with Bluetooth support, but it
> has not been yet loaded. Are we not exchanged one issue for another?

If it's started automatically by a package or during boot and
bluetooth.service is started before the module loaded, won't it
currently fail anyway? With the condition it just won't be attempted
to start.

Remember though that this isn't the normal mode of operation --
normally bluetooth.target gets activated through udev if/when BT
hardware actually becomes available:

  /lib/udev/rules.d/99-systemd.rules:SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_WANTS}+="bluetooth.target"

and bluetooth.service hooks into that in its [Install]. This is race
free as only the completion of the module load and the appearance of
/sys/class/bluetooth triggers the above rule. (For that case it seems
systemd (re-)starts an already failed bluetooth.service as well.)

So in summary, this is a little cleanup, doesn't affect the main
"dynamic via udev" case, but unclutters startup requests which aren't
triggered by hardware.

Thanks,

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

  reply	other threads:[~2015-10-20 14:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-20 10:24 [PATCH] systemd: Check if bluetooth is supported in the kernel Martin Pitt
2015-10-20 13:19 ` Marcel Holtmann
2015-10-20 14:10   ` Martin Pitt [this message]
2015-10-23 16:34 ` Johan Hedberg

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=20151020141055.GA2657@piware.de \
    --to=martin.pitt@ubuntu.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /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;
as well as URLs for NNTP newsgroup(s).