0

I have been experimenting with bluetoothctl and blueman. I have closed the window of blueman. I have also typed quit in bluetoothctl's command line interface. I have also run systemctl stop bluetooth. I have also sudo kill the pid of bluetoothctl, but its process is still using near 100% CPU. How can I make bluetoothctl quit running?

$ ps aux | grep blue
t        3906416  0.3  0.0  48244  3888 ?        Ss   18:15   0:39 /nix/store/6dhjbf41xw7xyrmzp70vp7rhrcb047ir-bluez-5.64/libexec/bluetooth/obexd
t        3912324 99.7  0.0 229748  2780 pts/4    R    18:40 194:01 bluetoothctl
t        3933330  2.5  0.5 801668 46136 ?        Ssl  20:45   1:45 /nix/store/xpwwghl72bb7f48m51amvqiv1l25pa01-python3-3.9.13/bin/python /nix/store/b49ck8cyjc88xcx82r4dr59nqq5rvjcy-blueman-2.2.4/bin/..blueman-applet-wrapped-wrapped
t        3933350  0.0  0.4 686092 33964 ?        Sl   20:45   0:00 /nix/store/xpwwghl72bb7f48m51amvqiv1l25pa01-python3-3.9.13/bin/python /nix/store/b49ck8cyjc88xcx82r4dr59nqq5rvjcy-blueman-2.2.4/bin/..blueman-tray-wrapped-wrapped
t        3944561  0.0  0.0 223452  2484 pts/4    S+   21:55   0:00 grep blue

1 Answer 1

3

Both bluetoothctl and blueman are different UI front-ends for the bluetooth service.

It appears there is something wrong with the bluetoothctl process, as it certainly should have exited with the quit command.

Since it seems to be running as user t (I assume it's your regular non-root user account), just use kill -9 3912324 to kill it. It might be in some sort of error state if you e.g. tried to use some Bluetooth LE functionality that your Bluetooth interface does not actually have, or because you've stopped the bluetooth service it's supposed to communicate with to do its job.

If you can reproduce the error state of bluetoothctl, you might want to make a bug report of it to the distribution you're using; no matter what the user does, the bluetoothctl command should not become stuck that way. You may have found a bug.

3
  • Thanks. I thought sudo kill will kill any process started by a regular user. Why can't it? Commented Jul 5, 2024 at 14:34
  • 1
    With sudo, you used the regular kill, which will send a SIGTERM signal to the process, which can be intercepted by the target process, e.g. to ensure the process can exit gracefully, or to prevent it being killed that way. kill -9 sends a SIGKILL instead, which is processed directly by the kernel, so the target process will have no way to influence it. kill -9 is an extreme way to kill a process, but in this case (stopping a hung UI front-end process whose backend service has already died in a more normal way) it is very unlikely to cause any harm. Commented Jul 5, 2024 at 14:46
  • 1
    Also, when you are the owner of the process, you have all the same powers over that process the root would have; using sudo kill instead of just kill will not bring any extra force. Since you are the process owner, adding sudo does nothing, but using kill -9 will forcefully terminate the process. Commented Jul 5, 2024 at 15:01

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.