WebFaction
Community site: login faq

Hi everyone,

What's the cleanest way to make a private instance of mySQL startup automatically in case the server gets rebooted?

Thanks!

asked 11 Oct '12, 12:14

sb56637
13713
accept rate: 0%


Create a cron job that looks like this:

@reboot ~/webapps/name_of_your_app/bin/cron > /dev/null 2>&1

Hope that helps!

permanent link

answered 11 Oct '12, 14:53

seanf
12.2k41836
accept rate: 37%

Sweet, thanks very much Seanf.

And what about some sort of watchdog script to see if my DB is responding? I've always used a shared DB server where if the DB went offline in the middle of the night, some other user would call and complain. But now with a personal instance, it could go offline and sit there hours before I notice it.

(11 Oct '12, 15:50) sb56637

Supervisor is what you need, but I don't have a step-by-step procedure to set it up. I know it's possible, as I've seen many of our customers running it.

(11 Oct '12, 15:56) seanf

Thanks again Seanf, I found a guide for configuring supervisor on Webfaction. I'll look into it.

One more little question about your solution to this question: What does /dev/null have to do with making mySQL restart after reboot?

Thanks!

(11 Oct '12, 16:04) sb56637

It doesn't really have anything to do with restarting MySQL. It suppresses output from the cron job - just something I tend to do with all of my cron jobs, unless I specifically want to log the output somewhere.

(11 Oct '12, 16:10) seanf

I see. Great, thanks!

(11 Oct '12, 16:15) sb56637
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×168
×11

question asked: 11 Oct '12, 12:14

question was seen: 2,356 times

last updated: 11 Oct '12, 16:15

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM