8

I know what the command is sytemctl disable NAME but I have a question about the NAME parameter.

For example the bluetooth service[1] on Fedora 21. For the NAME parameter should you put bluetooth or bluetooth.service or bluetooth.target?

Please note I am using bluetooth as an example but the question is meant to be generic (i.e. if a service has many associated units (i.e. socket, target, service)).


[1] When I searched for the bluetooth service I found a couple things that matched the "bluetooth" grep string:

$ systemctl list-unit-files|grep -i bluetooth
bluetooth.service                           enabled 
bluetooth.target                            static  
1
  • +1, and following this because I'd like to know if there's a simple way to disable services that have restarting dependencies (ala cups)
    – Jeff Schaller
    Nov 11, 2015 at 14:34

1 Answer 1

5

Services are defined in unit files that have a .service suffix.

When using systemctl to disable a service specifically, you should specify the full name of the unit file (e.g. bluetooth.service). If you omit the .service suffix, then .service is assumed. So, for example, the following two commands are equivalent:

With an explicit .service suffix:

$ systemctl disable bluetooth.service

With an implicit .service suffix:

$ systemctl disable bluetooth

Regarding the bluetooth.target file: the concept of SysV Init Runlevels has been replaced with targets in systemd. You should refer to man systemd.target for more information.

You must log in to answer this question.

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