how to stop apache2, mysql from starting automatically as computer starts?
MySQL is handled by upstart. In 11.04 you can use the new override feature to modify the starting behaviour:
echo "manual" >> /etc/init/mysql.override
See the section "Disabling a Job from Automatically Starting" in the Upstart Cookbook
Apache still uses traditional SysV init scripts so you use
update-rc.d -f apache2 remove
to remove the links from /etc/rcX.d
or, alternatively, use
update-rc.d apache2 disable
which "disables" the script by changing it from a start script S91apache2
to a stop script K09apache2
. This is reversible by update-rc.d apache2 enable
.
Interestingly, it's a different answer for each package in 11.04.
- apache2 uses System V style init scripts. To disable it from boot:
sudo update-rc.d -f apache2 remove
- However, mysql uses an Upstart job, to disable it, create an "override" file:
echo "manual" | sudo tee /etc/init/mysql.override
To learn more about override files, see: The Upstart Cookbook
This thread will help you: https://superuser.com/questions/35151/how-do-i-stop-services-from-starting-on-boot-on-ubuntu