pand in /etc/init.d/bluetooth fails with "Failed to connect to the local SDP server. Connection refused(111)" error. Solution included

Bug #121915 reported by dum
12
Affects Status Importance Assigned to Milestone
bluez-utils (Debian)
Fix Released
Unknown
bluez-utils (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: bluez-utils

pand in /etc/init.d/bluetooth fails with "Failed to connect to the local SDP server. Connection refused(111)" error. The reason is hcid doesnt not jet listen, but pand ialready tries connect to it. Small workaround: insert sleep in /etc/init.d/bluetooth as I have done:

        start-stop-daemon --start --quiet --exec $HCID -- $HCID_OPTIONS || true
        log_progress_msg "hcid"

        sleep 1

        start_uarts || true

        start_hid || true
        enable_hci_input || true
        start_rfcomm || true
        start_pan || true
        log_end_msg 0

Revision history for this message
Marcel Holtmann (holtmann) wrote :

These race conditions are all fixed now. The hcid will start other services like network service (which replaced pand).

Revision history for this message
Richard Bailey (rmjb) wrote : Re: dund in /etc/init.d/bluetooth fails with "Failed to connect to the local SDP server. Connection refused(111)" error. Solution included

This problem persists in Gutsy for dund. Adding a sleep 1 at the recommended place fixes the issue.

Revision history for this message
Feanor (angelo-pantano) wrote :

this problem persists even in hardy. the "sleep 1" workaround doesnt seem to fix it either.

i still get connection refused if i try to connect my nokia sdp server via bluetooth:

feanor@eldar:~$ sudo sdptool browse 00:1D:6E:B8:11:30:
Failed to connect to SDP server on 00:1D:6E:B8:11:30: Connection refused

Changed in bluez-utils:
status: Unknown → New
Revision history for this message
Brad Campbell (brad-wasp) wrote :

I'm seeing this also in Hardy/8.04.

I need to modify /etc/init.d/bluetooth thusly.. (different but similar to above as I'm only using dund)

start_pan()
{
        if test "$DUND_ENABLED" != "0"; then
+ sleep 1
                start-stop-daemon --start --quiet --exec $DUND_DAEMON -- $DUND_OPTIONS
                [ "$VERBOSE" != no ] && log_progress_msg "pand"

Or else the result is as below. dund does not register SDP and I can't use it until I manually kill it and restart it.

May 14 17:32:44 bkmac hcid[17710]: Bluetooth HCI daemon
May 14 17:32:44 bkmac hcid[17710]: HCI dev 0 registered
May 14 17:32:44 bkmac hcid[17710]: HCI dev 0 already up
May 14 17:32:44 bkmac hcid[17710]: Device hci0 has been added
May 14 17:32:44 bkmac hcid[17710]: Starting security manager 0
May 14 17:32:44 bkmac dund[17714]: Bluetooth DUN daemon version 3.26
May 14 17:32:44 bkmac dund[17714]: Failed to connect to the local SDP server. Connection refused(111)
May 14 17:32:45 bkmac hcid[17710]: Device hci0 has been activated
May 14 17:32:45 bkmac hcid[17710]: Starting SDP server
May 14 17:32:45 bkmac hcid[17710]: Created local server at unix:abstract=/var/run/dbus-Ewgr5cfEin,guid=e1de9f92a6182efb448ff00c482ae9fd
May 14 17:32:45 bkmac input[17720]: Bluetooth Input daemon
May 14 17:32:45 bkmac input[17720]: Registered input manager path:/org/bluez/input
May 14 17:32:45 bkmac audio[17721]: Bluetooth Audio daemon
May 14 17:32:45 bkmac audio[17721]: Unix socket created: 5
May 14 17:32:45 bkmac audio[17721]: audio.conf: Key file does not have key 'Enable'

Changed in bluez-utils (Debian):
status: New → Fix Released
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

according to the debian bug report, this was fixed:

Fixed in version 4.42-2

Closing as Fix Released.

Changed in bluez-utils (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.