Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 664  / 3 Years ago, sun, october 17, 2021, 7:52:17

I have a laptop. I use it for web+email a lot, and then some days for web development. Using it for the latter, I need apache2 and mysql server running, but normally I do not.



I'd like a normal boot to NOT start apache and mysql, to conserve power, reduce boot times etc. but then to be able to start these services when needed.



In the olden days I might have used runlevels for this, but that's a bit old skool now, as I understand. What's the best way to achieve this in Precise?


More From » 12.04

 Answers
3

A way to do it with good ol' runlevels:



MySQL now uses an upstart script, but inside that it's still talking about runlevels. Edit /etc/init/mysql.conf and change lines as in this diff:



-start on runlevel [2345]
-stop on starting rc RUNLEVEL=[016]
+start on runlevel [345]
+stop on starting rc RUNLEVEL=[0126]


Apache2 still uses runlevel rc.N.d sym links:



sudo update-rc.d -f apache2 remove 
sudo update-rc.d apache2 start 91 3 4 5 . stop 09 0 1 6 .


Then on a normal boot (runlevel 2), they won't be started, and when you do sudo telinit 3, they will.


[#36764] Monday, October 18, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tersle

Total Points: 342
Total Questions: 109
Total Answers: 99

Location: Kazakhstan
Member since Mon, Sep 26, 2022
2 Years ago
;