Discover How To Learn Tips And Tricks HOWTOs

What Are Masked Services in Linux, and How Do You Manage Them?

32.Lock Code Circular Esm W900

Here's everything you need to know about masked services in Linux.


Have you ever gone to start or stop a service in Linux using the systemctl command only to see a warning such as:

Failed to start postgresql.service: Unit postgresql.service is masked

You know you installed the Postgresql database server and it was working properly, yet somehow you no longer have control over the service. You can’t manage it in any way. What happened?

First of all, masks are a different way of disabling a service. Here’s the difference: When you disable a service with sudo systemctl disable, all symlinks for the service are removed. When masking a service, the symlinks are moved and then point to /dev/null. When you simply disable a service, it can still be started manually. When you mask a service, it cannot be started manually. In other words, masking a service renders the service permanently unusable until it’s unmasked.