Hi,
I usually use Apache+PHP+MySQL on Windows. There I set both Apache and MySQL as manually started services, so they only up and running (hence consume resources) when I actually use them. AFAIK both defaults to start on system start and only shutdown on system shutdown. Can I achieve the same setup like on Windows in Mint? How?
Thanks
Setting Apache and MySQL to start/shutdown manually
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Re: Setting Apache and MySQL to start/shutdown manually
Starting Apache and MySQL will take some additional time, but other than that if you give these services nothing to do they won't impact your system performance (they won't eat much CPU in idle; and any memory they need goes to swap). However, and you can probably do this through the GUI as well, here goes with a few commands to switch them to manual.
List all the services on your machine:
Look for the apache and mysql service name. Once you have the correct name for the apache and mysql service from that list, switch each service to manual with the following command (replace <servicename>, including the angle brackets, with the service name from the list):
After reboot those services will not start automatically. You can start them with:
List all the services on your machine:
Code: Select all
initctl list
Code: Select all
echo manual | sudo tee -a /etc/init/<servicename>.override
Code: Select all
sudo initctl start <servicename>

Re: Setting Apache and MySQL to start/shutdown manually
Thanks for the info.
I was thinking to write a shell script to start/stop those services. I note that each time I 'sudo' Mint ask for password. Are there any command that lets me set an elevated privilege once, do multiple things at that privilege, then return to normal privilege?
I was thinking to write a shell script to start/stop those services. I note that each time I 'sudo' Mint ask for password. Are there any command that lets me set an elevated privilege once, do multiple things at that privilege, then return to normal privilege?
Re: Setting Apache and MySQL to start/shutdown manually
You can just sudo the shell
To run a shell as superuser:
Any commands can be run now without sudo. Type exit to return to normal shell.
Or you can just login as root:

Code: Select all
sudo bash
Or you can just login as root:
Code: Select all
sudo -i
