Tuesday, May 14, 2024
 Popular · Latest · Hot · Upcoming
17
rated 0 times [  17] [ 0]  / answers: 1 / hits: 31961  / 1 Year ago, thu, december 22, 2022, 11:49:42

I have mysql installed (from repos) on a development machine (laptop) and I don't need the daemon running on every boot. I've copied /etc/init/mysql.conf to /etc/init/mysql.conf.old and then removed everything following the "start on" line. However, upon reboot, I can no longer start mysqld through upstart:



$ sudo service mysql start
start: Unknown job: mysql


This also fails (trying anything at this point):



$ sudo service mysql restart
stop: Unknown job: mysql
start: Unknown job: mysql


This is my upstart script:



# /etc/init/mysql.conf
....
start on
stop on starting rc RUNLEVEL=[016]


This is the default script:



# /etc/init/mysql.conf.old
....
start on runlevel [2345]
stop on starting rc RUNLEVEL=[016]


Everything I've read up until now suggests that this is how services can be prevented from starting at boot-time. Is there a better way to do this or did I make a mistake in the upstart script?



UPDATE: I've moved the backup conf file out of /etc/init and rebooted thinking that maybe there was a conflict but upstart still says Unknown job: mysql


More From » upstart

 Answers
0

If you are on Ubuntu 11.04 or later, you can use the manual keyword and .override files in /etc/init to disable automatic starting:



sudo sh -c 'echo manual >> /etc/init/mysql.override'


manual effectively removes the start on stanza from the job's config.



If you are on Ubuntu 10.04, you can do this:



sudo sh -c 'echo start on never >> /etc/init/mysql.conf'


The last start on in the file will override any previous ones, so this should work, though it assumes there is no event called never.


[#36379] Friday, December 23, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
unsmmoth

Total Points: 72
Total Questions: 113
Total Answers: 95

Location: Thailand
Member since Tue, Oct 6, 2020
4 Years ago
;