I went through some manuals and I didn't understand yet. How do I disable autostart nginx service?
Asked
Active
Viewed 1.1e+01k times
2 Answers
66
Update:
I made changes to supports more distributions:
use this:
sudo systemctl disable nginx
It will disable it and if you like to stop running service use this:
sudo systemctl stop nginx
works on Ubuntu and any Systemd based distributions
S.M.Mousavi
- 1,176
-
3
-
1If you're going to use systemd style, use it for everything, don't have some weird mashup of using the
serviceshim for some commands. That second one should just besudo systemctl stop nginx. – Félix Saparelli Sep 12 '20 at 12:26 -
-
1
sudo update-rc.d -f nginx disable. What is the difference between them? – Alex Malex Aug 17 '12 at 14:15disableis better! :) You got me. It effectively 'makesdpkgaware of your preference to prevent the startup scripts from being executed (becausedpkgruns update-rc.d too)'. Credit to @Lekensteyn for the explanation. – SirCharlo Aug 17 '12 at 14:19disableand thenremove. How can I undo it? – Alex Malex Aug 17 '12 at 14:32sudo update-rc.d nginx defaults; sudo update-rc.d -f nginx disable– SirCharlo Aug 17 '12 at 15:26