1

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.

piwi
  • 336
  • 1
  • 3
  • 12

2 Answers2

2

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.

coredump
  • 12,573
  • 2
  • 34
  • 53
  • 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 08:45
0

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.

sendmoreinfo
  • 1,742
  • 12
  • 33