login community faq

I recently created a rails 3.0.5 app, and it appears that this line was added to my crontab:

1
8,28,48 * * * * /home/<user>/webapps/<app>/bin/start

As a result, I get emails every 20 minutes with the following errors, presumably because it's trying to start an nginx instance that's already running:

1
2
3
4
5
6
[emerg]: bind() to 0.0.0.0:11323 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:11323 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:11323 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:11323 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:11323 failed (98: Address already in use)
[emerg]: still could not bind()

I changed the line in my crontab to run restart instead of start, but I'm not sure whether it's even necessary. Should I just delete it?

asked Aug 04 '11 at 01:35

chrispix's gravatar image

chrispix
306

Hi,

You should not remove as it is meant to restart your in case its nor unning. You can instead redirect its output to /dev/null by adding "> /dev/null 2>&1"

(Aug 04 '11 at 01:49) neeravk ♦♦ neeravk's gravatar image

@neeravk isn't it better to run restart then, since it's most likely already running? I've never seen this on an nginx installation before.

(Aug 04 '11 at 18:48) chrispix chrispix's gravatar image

[Edit] Using restart is fine. However, it will terminate active sessions, so redirecting the output to /dev/null will allow this to fail silently as expected.

(Aug 04 '11 at 19:50) johns ♦♦ johns's gravatar image

Ah, good point about sessions. Thanks @johns!

(Aug 05 '11 at 12:48) chrispix chrispix's gravatar image
Be the first one to answer this question!
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

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