login community 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 Oct 11 '12 at 12:14

sb56637's gravatar image

sb56637
34


Create a cron job that looks like this:

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

Hope that helps!

answered Oct 11 '12 at 14:53

seanf's gravatar image

seanf ♦♦
56541220

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.

(Oct 11 '12 at 15:50) sb56637 sb56637's gravatar image

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.

(Oct 11 '12 at 15:56) seanf ♦♦ seanf's gravatar image

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!

(Oct 11 '12 at 16:04) sb56637 sb56637's gravatar image

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.

(Oct 11 '12 at 16:10) seanf ♦♦ seanf's gravatar image

I see. Great, thanks!

(Oct 11 '12 at 16:15) sb56637 sb56637's gravatar image
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
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

Tags:

×116
×8

Asked: Oct 11 '12 at 12:14

Seen: 545 times

Last updated: Oct 11 '12 at 16:15

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited