« Back to Systemd: Frequently Asked Questions

How to see all masked units with systemctl

Systemd uses the concept of masked units that prevents those units from being started. This can be used for one-time tasks, like those that need to be executed only the first time after the installation. Another reason is that a system administrator might want to disable an unused service or one that is being tested.

Show masked units

To show the masked units, we can ask systemctl to show all unit files with a state of masked.

systemctl list-unit-files --state=masked

When there are matches, the output could look like this:

# systemctl list-unit-files --state=masked
UNIT FILE                STATE  PRESET 
cryptdisks-early.service masked enabled
cryptdisks.service       masked enabled
hwclock.service          masked enabled
rc.service               masked enabled
rcS.service              masked enabled
screen-cleanup.service   masked enabled
sudo.service             masked enabled
x11-common.service       masked enabled

8 unit files listed.

Unmask a unit or service

In most cases, a masked unit is a service. Need a particular service to run again? Use the unmask command.

systemctl unmask NAME.service

Learn more about systemctl

This article uses the systemctl command to achieve its tasks. For this popular tool there is a cheat sheet available!

» Mastering the tool: systemctl

systemctl cheat sheet

Other questions related to systemd

Feedback

Is the described answer not working or incorrect, got another tip or question? Share your thoughts!