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
This is a multi-part message in MIME format. --------------030805040205080708010907 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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 --------------030805040205080708010907 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="rc.d-bluetooth.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="rc.d-bluetooth.patch" --- /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 --------------030805040205080708010907--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55FF51F7.8030404>