So here is the context. I have a Debian Squeeze (solely command-line) installed as a guest in VirtualBox. I installed MySQL, but decided to disable it on startup. So i found out that I can use update-rc.d -f mysql remove to do so.

This I did before finding this: Recommended way to disable a service in Debian. But in any case I lack the knowledge to fully understand this Q&A. My point is that my problem is maybe that I'm using the update-rc.d command; you tell me!

Anyway, this works fine so far, as well as launching the service using the /etc/init.d/mysql start command when I need it. The problem I encounter is that when I issue the halt command, this service eventually leads to an error. I took a screenshot, but because I don't have enough reputation points (yet!), I cannot post the image; here is the link to it: http://imgur.com/Trpf8.

Could someone explain to me what is the problem? As well as point me to means to solve it?

Thanks a lot for your time.


You must do some reading. Then you will understand that some special links are created on the runlevel directories, some are to start mysql and some are to stop mysql when leaving the runlevel (like when you are halting the machine).

The best solution is:

  • Reinstall the mysql links update-rc.d mysql defaults (I think you may need a -f too)
  • Correctly disable the mysql service update-rc.d mysql disable (also, you may need a -f

That will let the K links there and rename the S links. I hope you did the reading to understand what this last part means.

  • Thanks, the Debian's documentation was indeed helpful, and you're right that the two commands allowed me to re-set the links and then disable the MySQL service correctly. However, if MySQL is running (because I started it manually), then halting the system raises the same error. Any idea? Thanks! – piwi Apr 10 '12 at 8:45

I think you can use update-rc.d to make shutdown links, but not startup links for the service. Then it would be shut down gracefully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.