Bluetooth doesn't work in Fedora 15 when system wakes up or changes runlevel

1

I'm experiencing weird problem when using Bluetooth on Fedora 15. First, to get Bluetooth working, I had to follow this post.

Now, when I boot up and login (runlevel 5, GNOME 3), systemctl status bluetooth.service results in:

bluetooth.service - Bluetooth Manager
      Loaded: loaded (/lib/systemd/system/bluetooth.service)
      Active: active (running) since Wed, 08 Jun 2011 08:34:17 +0200; 56s ago
    Main PID: 893 (bluetoothd)
      CGroup: name=systemd:/system/bluetooth.service
          ├  893 /usr/sbin/bluetoothd -n
          ├ 1989 [khidpd_045e0700]
          └ 2000 [khidpd_045e0762]

So everything's fine.

However, when I change runlevel or tell system to sleep, Bluetooth stops working. systemctl status bluetooth.service results in:

bluetooth.service - Bluetooth Manager
      Loaded: loaded (/lib/systemd/system/bluetooth.service)
      Active: inactive (dead) since Wed, 08 Jun 2011 08:37:57 +0200; 40s ago
     Process: 860 ExecStart=/usr/sbin/bluetoothd -n (code=exited, status=0/SUCCESS)
      CGroup: name=systemd:/system/bluetooth.service

And I have to restart it (systemctl restart bluetooth.service) to get it working again. This is inconvenient, as my main keyboard is a Bluetooth one.

Everything worked fine on Fedora 14.

So, how can I make it work without having to restart Bluetooth service every time I change runlevel?

Dr McKay

Posted 2011-06-08T06:54:39.460

Reputation: 278

Answers

2

You can configure the Bluetooth service to automatically restart on exit. To do so, first copy the bluetooth.service file from /lib/systemd/system/ to /etc/systemd/system/. Then, add the following line to the [Service] section of the newly copied file:

Restart=always

Finally, alert systemd that its configuration has been changed by running this command (as root):

systemctl daemon-reload

Now, whenever the Bluetooth daemon exits, as it's doing when your system sleeps, systemd will automatically restart it.

Patches

Posted 2011-06-08T06:54:39.460

Reputation: 14 078

I've tried that before. Daemon is still active after waking PC up, but my devices can't connect. – Dr McKay – 2011-06-20T08:07:37.910

@Dr McKay: In that case, it's probably a bug. I suggest that you report it. File it in the bluez package. They'll send it along to the systemd or udev folks if that's where the problem is.

– Patches – 2011-06-20T08:32:29.410