81

I installed these applications on my Ubuntu:

  • nginx

  • php5-fpm

  • mysql server

  • redis

  • ...

These applications run every time the computer turns on.

How can I prevent these applications from running on start up?
So, these applications only run if I do "service nginx start".

Alexis Wilke
  • 2,787
Cakka
  • 911

3 Answers3

172

Use:

systemctl disable <service>

If you are not using systemd (Ubuntu 14.10 and earlier) use:

update-rc.d -f <service> remove

The following command will give you a list of all services on your machine:

service --status-all

You should be able to find the names of the services you want to disable in there.

For more details, see enabling-and-disabling-services and for the very long answer see this post (as already mentioned by @muru).

For more details, see this post on Digital Ocean and the man page for systemctl.

qwertzguy
  • 693
  • 1
  • 7
  • 16
NZD
  • 3,301
  • 1
  • 15
  • 22
-1

Another method is by installing rcconf apt-get install rcconf. From rcconf you can enable/disable any service that is installed on your ubuntu/debian server.

-1

Install sysv-rc-conf

apt-get install sysv-rc-conf

Then simply to list services

sysv-rc-conf --list

To disable any services i.e nginx

sysv-rc-conf nginx off

For more information see man sysv-rc-conf

Juned
  • 101