Comment 3 for bug 1221618

Revision history for this message
Bruce.Ma (bruce.ma) wrote :

# Root cause, if the bluetooth(kernel module and hardware) didn't finished the initial. Then:
bluez-4.98/src/main.c :
439 int main(int argc, char *argv[])
... ..
511 if (connect_dbus() < 0) {
512 error("Unable to get on D-Bus");
                                   ^^^^^^^^
// The function connect_dbus() will return a non-zero, so will output a log "Unable to get on D-Bus".

385 static int connect_dbus(void)
386 {
387 DBusConnection *conn;
388 DBusError err;
389
390 dbus_error_init(&err);
391
392 conn = g_dbus_setup_bus(DBUS_BUS_SYSTEM, BLUEZ_NAME, &err);
                                ^^^^^^^^^^^^^^^^
393 if (!conn) {
394 if (dbus_error_is_set(&err)) {
                               ^^^^^^^^^^^^^^^
395 g_printerr("D-Bus setup failed: %s\n", err.message);
396 dbus_error_free(&err);
397 return -EIO;
398 }
399 return -EALREADY;

// The value "conn" is non-zero and dbus_error_is_set(&err)) will return none-zero too.

Just restart the bluetooth service by manual, bluetoothd will be startup correctly.
  sudo service bluetooth restart