42

I have lots of servers installed (Apache, MySQL, etc.), but I don't want them all to start at boot time (they drain power, and I'm on batteries most of the time). How do I configure this?

54

In the console, you could write:

sudo update-rc.d -f apache2 remove
sudo update-rc.d -f mysql remove
...

For additional information read Ubuntu Bootup How to.

11

Things have changed quite a bit in Ubuntu now. I think from version 11 onwards. MySQL is handled by Upstart while Apache still uses traditional SysV init scripts

For MySQL, you can use the new override feature in Upstart to modify the starting behaviour:

sudo echo "manual" >> /etc/init/mysql.override

For more info, see the section "Disabling a Job from Automatically Starting" in the Upstart Cookbook.

As Apache still uses the traditional SysV init scripts you can use

sudo update-rc.d -f apache2 remove

to remove the links from /etc/rcX.d or, alternatively use

sudo update-rc.d apache2 disable

which "disables" the script by changing it from a start script to a stop script. This is reversible by

sudo update-rc.d apache2 enable


Most of this information I got from here: https://askubuntu.com/a/40077/24678

  • I get "bash: /etc/init/mysql.override: Permission denied" when run "sudo echo "manual" >> /etc/init/mysql.override" in Ubuntu 14.04. – Hung Tran Mar 24 '15 at 2:48
  • 1
    @HungTran - As superuser, try creating the file /etc/init/mysql.override with an editor - with contents containing the word manual – Wavesailor Apr 8 '15 at 13:55
5

This link is a bit out dated version wise, but does it match an option in your version?

Configure startup services

This requires administrative privileges (see Chapter 2, Administrative Tasks).

  1. Run Services Settings: SystemAdministrationServices.
  2. Enter your password.
  3. Select the services you want running, then click OK when done.
4

You can use Boot-Up Manager for start and stop boot-up scripts, without the necessity to handle thru complex links and permissions.

apt-get install bum

enter image description here

3

Another way to accomplish this is to 'disable' the sym link - not delete it.

sudo update-rc.d mysql disable 2

This will rename the sym link to start with 'K' and the service won't start-up on boot. You can then re-enable it at any time if you do decide you want it to start-up on boot.

1

On Ubuntu 16:

 sudo systemctl disable mysql

update-rc.d method wasn't working for me.

Upstart has been deprecated in Ubuntu 15.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.