3

There is a bug in Ubuntu that prevents bluetoothd from starting when the computers wakes up from hibernate. So far there is no solution. I am fed upstarting bluetoothd manually every time, I think a possible workaround may be to automatically do the following on waking up:

  1. Check if bluetoothd is running.
  2. If it is not running, start it.

I would appreciate if someone could give me an advice on how to implement that. Which startup script executes when Ubuntu wakes up from hibernate? How to check if the daemon is running?

2 Answers 2

3

You should drop the file in /etc/pm/sleep.d . All the scripts in this dir are executed when a power manage event happens. You can check the first parameter to know what event has invoked the script.

There is a nice example in this answer

2

If you get a login screen when your computer wakes-up, a simple solution will be to add service bluetooth start to your ~/.profile because GNOME will execute commands in this file when you login. If you dont use GNOME or if you dont get a login screen then you can add a file to /etc/pm/sleep.d with followiing lines in it

#!/bin/sh

case "$1" in
    thaw)
        service bluetooth start        
        ;;  
esac

this will script will start bluetooth service i.e bluetoothd whenever your system comes back from sleep/hibernation

2
  • It's not possible to start a system service as a normal user (well, not without special sudo permissions).
    – JanC
    Dec 13, 2010 at 13:32
  • Yes but the scripts in /etc/pm/sleep.d get executed with root permissions.
    – binW
    Dec 13, 2010 at 14:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .