From owner-freebsd-bluetooth@freebsd.org Sun Sep 20 23:30:28 2015 Return-Path: Delivered-To: freebsd-bluetooth@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70416A0613C for ; Sun, 20 Sep 2015 23:30:28 +0000 (UTC) (envelope-from erdgeist@erdgeist.org) Received: from elektropost.org (elektropost.org [217.115.13.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB52213B6 for ; Sun, 20 Sep 2015 23:30:26 +0000 (UTC) (envelope-from erdgeist@erdgeist.org) Received: (qmail 73752 invoked from network); 20 Sep 2015 23:30:23 -0000 Received: from elektropost.org (HELO elektropost.org) (erdgeist@erdgeist.org) by elektropost.org with ESMTPS (DHE-RSA-AES128-SHA encrypted); 20 Sep 2015 23:30:23 -0000 To: freebsd-bluetooth@freebsd.org From: Dirk Engling Subject: service bluetooth start ubt0 fails every other time X-Enigmail-Draft-Status: N1110 Message-ID: <55FF418D.10806@erdgeist.org> Date: Mon, 21 Sep 2015 01:30:21 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2015 23:30:28 -0000 When initially calling service bluetooth start ubt0, I usually get an error: /etc/rc.d/bluetooth: ERROR: Unable to setup Bluetooth stack for device ubt0 When tracking the error down, I can link it to the command ngctl mkpeer ubt0: hci hook drv ngctl: send msg: File exists So I assume, when attaching my usb host controller, the usb framework has already launched the bluetooth start ubt0? Is that correct? What happens then is that bluetooth_shutdown_stack $dev is called, actually shutting down the device. This is exactly the opposite of the expected effect. 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? erdgeist