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
30127
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

Question tags:

×170
×101
×43

question asked: 04 Aug '11, 01:35

question was seen: 1,287 times

last updated: 05 Aug '11, 12:48

Features & prices    Sign up    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
© Copyright 2003-2015 Swarma Limited - WebFaction is a service of Swarma Limited