What is a masked service?

I would like to understand what a masked service is and how to unmask it if need be.

I have been trying to start PostgreSQL on Ubuntu 16.04-LTS using the command

systemctl start postgresql.service.

Both as a user with administrative privileges, as well as root respectively.

Unfortunately, I got

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

printed in both scenarios.

1

2 Answers

Masking a service will prevent it from starting.

To unmask a service run:

systemctl unmask name.service

Source:

How to Manage Systemd Services on a Linux System | How To Geek

2

I have found that this error message results from errors in the service creation process. Such as not naming the file .service but instead .sevrice.

I was attempting to create a service and when setting it up I sometimes transposed letters in the file extension. As a result systemd on ubuntu 21.10 reported that my service was masked and when I unmasked the service ubuntu deleted the service file like it was a thief that had been unmasked :^). Confused me for a few minutes until I saw the tranposed letters.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like