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

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:

[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 04 Aug '11, 01:35

chrispix's gravatar image

chrispix
3016
accept rate: 100%

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"

(04 Aug '11, 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.

(04 Aug '11, 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.

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

Ah, good point about sessions. Thanks @johns!

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

Tags:

×157
×92
×41

Asked: 04 Aug '11, 01:35

Seen: 980 times

Last updated: 05 Aug '11, 12:48

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