On a system that is using systemd for service control, you can get all the services status with:
systemctl list-unit-files -t service -all.
$ systemctl list-unit-files -t service -all
UNIT FILE STATE
Here you notice there are 4 types of service states.
- static -- Service is started and used by another service
- masked -- Service is masked and thus forced to not start
For example, the
alsa-state services are pulled in by the basic.target by default. This can be checked by:
$ systemctl show -p WantedBy alsa-restore alsa-state
But simply disabling the service doesn't work, so you need to mask it.
$ sudo systemctl mask alsa-restore.service
Created symlink /etc/systemd/system/alsa-restore.service → /dev/null.
$ sudo systemctl daemon-reload
man systemctl states:
Mask one or more units, as specified on the command line. This will link these unit files to /dev/null, making it impossible to start them. This is a stronger version of disable, since it prohibits all kinds of activation of the unit, including enablement and manual activation. Use this option with care. This honors the
--runtime option to only mask temporarily until the next reboot of the system. The
--now option may be used to ensure that the units are also stopped. This command expects valid unit names only, it does not accept unit file paths.
That should disable it from re-loading on boot.