Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Sep 2015 02:40:23 +0200
From:      Dirk Engling <erdgeist@erdgeist.org>
To:        freebsd-bluetooth@freebsd.org
Subject:   Re: service bluetooth start ubt0 fails every other time
Message-ID:  <55FF51F7.8030404@erdgeist.org>
In-Reply-To: <55FF418D.10806@erdgeist.org>
References:  <55FF418D.10806@erdgeist.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On 21.09.15 01:30, Dirk Engling wrote:

> Maybe the rc script should check if the stack is already set up and exit
> with a more verbose error and then not shut down the interface?

I think the attached patch does what is needed. Looking forward to your
comments.

  erdgeist

[-- Attachment #2 --]
--- /etc/rc.d/bluetooth	2015-08-12 16:21:53.000000000 +0200
+++ bluetooth	2015-09-21 02:29:52.113993498 +0200
@@ -95,6 +95,10 @@
 	hook=$1
 	shift
 
+	# Check if stack is already set up for device
+	ngctl status ${dev}hci: 2> /dev/null > /dev/null &&
+		err 0 "Stack already set up for ${dev}" && return 0
+
 	# Setup HCI
 	ngctl mkpeer ${dev}: hci ${hook} drv \
 		> /dev/null 2>&1 || return 1

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55FF51F7.8030404>