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

How can I solve this? (Ubuntu 16.04.1 LTS)

sudo service postgresql restart
Failed to restart postgresql.service: Unit postgresql.service is masked.
2

2 Answers

Ubuntu 15.04 and earlier used upstart. Upstart uses the service command to handle services. As of 16.04 Ubuntu is using systemd. Any service commands you use get remapped to systemctl commands. Systemd provides more functionality than upstart, including the ability to mask a service so that it cannot be started. Masking a service (from what I understand) essentially symlinks it to /dev/null. You should be able to unmask and restart the service with the following commands.

systemctl unmask postgresql
systemctl restart postgresql
1

if you are using Docker. then make sure the container is running. do that by typing Docker ps. if the container is missing but appears in Docker ps -a then just use Docker start

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