3

I have disabled the bluetooth service using "systemctl disable bluetooth.service", and also using systemd-manager, but it still starts at boot-time. I'm using Ubuntu 18.04 amd64.

I suppose it is being activated by another service, but how can I find and stop it?

I would like to stop it from loading in the first place, rather than stop it afterwards by for example putting a line in /etc/rc.local. I also want to activate it when needed, and so not make bluetooth.service unexectuable or use similar hacks.

Thanks very much.

2 Answers 2

3

In general, another service that has a "Requires=yourservice" might cause it to start even if it's disabled.

Look for your service in the list generated by:

systemctl list-dependencies

If you find that bluetooth is linked to another service you can edit using:

systemctl edit --full evilbluetoothstarting.service

After=bluetooth.service

That should create a seperate file that survives upgrades.

Now as for disabling bluetooth, you might just need to change a parameter after disabling the service:

vim /etc/bluetooth/main.conf

AutoEnable=true

=>

AutoEnable=false

5
  • Hi, I can't find bluetooth on the output of systemctl list-dependencies... output is on pastebin: pastebin.com/iYGHZssb Commented Jun 12, 2019 at 17:45
  • It does show up though on systemd-analyze: systemd-analyze critical-chain bluetooth.service: pastebin.com/3bWpuMtz Commented Jun 12, 2019 at 17:57
  • ...Is there any other way to investigate this? Thanks. Commented Jun 12, 2019 at 18:08
  • @LukeSharkey : Mhh whats the output of "systemctl status PID" ? I guess you canuse "ps -ef | grep bluetooth" to get the pid, I don't actually have bluetooth :)
    – HoD
    Commented Jun 13, 2019 at 8:40
  • "Systemctl status bluetooth" showed that it was active (I didn't need to use the Process ID). Using "systemctl list-dependencies bluetooth --reverse" showed that it was being started by tlp. Thanks Commented Jun 14, 2019 at 14:51
0

Researching on internet i found out the following information:

https://geekflake.com/how-to-start-services-on-boot-in-linux/

The information explain that to elect which services start at booting process in the OPerative System To edit this on system has to be on /etc/init.d/ And has to be done with the command chkconfig with --add parameter or enable, disable using systemctl for example:

systemctl enable bluetooth

You must log in to answer this question.

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