Is there a way to make apache and mysql not run automatically on startup?
Currently, whenever I boot my machine, they start automatically and run in the background.
I am using Ubuntu 12.04.
Is there a way to make apache and mysql not run automatically on startup?
Currently, whenever I boot my machine, they start automatically and run in the background.
I am using Ubuntu 12.04.
sudo update-rc.d -f apache2 disable
Apache is still using rc.d init script, which is why you must disable it using update-rc.d
.
echo manual | sudo tee /etc/init/mysql.override
MySQL on the other hand has converted to an upstart configuration file. The recommended way of disabling upstart services is to use an override file.
For all system services in /etc/init.d
, disabling them can be done with the update-rc.d
command, e.g.:
update-rc.d -f apache2 remove
To restore it to running on startup:
update-rc.d apache2 defaults
You can also manually start and stop via service apache2 start
and service apache2 stop
.
Run the following in a terminal:
update-rc.d -f apache2 remove
update-rc.d -f mysql remove
see: http://www.aboutlinux.info/2006/04/enabling-and-disabling-services-during_01.html
.conf
file in/etc/init
(like mysql), is to run as root:echo "manual" >> /etc/init/[service_name].override
. – José Fernández Ramos Nov 23 '12 at 10:41sudo mv /etc/init/cups.conf /etc/cups.conf.disabled
. It's easier to see what services are disabled when you do this. Re: Can you remove printer support (cups) – Gerard Roche Dec 07 '12 at 11:40update-rc.d
on MySQL? – Ehtesh Choudhury Feb 04 '14 at 18:56