Nginx – Unit nginx.service is masked

Upgraded a Nginx Server to the latest 1.15.x, but hits the following error message :

Terminal

$ sudo service nginx status
* nginx.service
   Loaded: masked (/dev/null; bad)
   Active: inactive (dead)

$ sudo service nginx restart
Failed to restart nginx.service: Unit nginx.service is masked.

Solution

To solve it, just unmask with this : sudo systemctl unmask nginx.service

Terminal

$ sudo systemctl unmask nginx.service

References

  1. How to Manage Systemd Services on a Linux System
  2. systemd: Masking units

mkyong

Founder of Mkyong.com, passionate Java and open-source technologies. If you enjoy my tutorials, consider making a donation to these charities.

2 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Ikke
6 years ago

Thanks

Aniran
6 years ago

Where should I ask why some service was masked by systemctl?
example: sudo.service
It feels like half the world was not prepared for systemd but they went ahead anyway. Its incredibly frustating. Half documentation about linux is now worthless because of systemd.