addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwchatcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgoogleimageimagesinstagramlinklocation-pinmagnifying-glassmailminusmoremuplabelShape 3 + Rectangle 1outlookpersonplusprice-ribbonImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruseryahoo

Re: [ruby-75] How do you clean stale PID files?

From: user 6.
Sent on: Tuesday, October 6, 2009 1:23 PM
I assume you have stopped mongrel first with (following commands are all from the top level dir of your app):

mongrel_rails cluster::stop

You can usually clear PIDs with this: 

rake tmp:pids:clean

If you can't remember the name of a rake task, the -T flag is extremely useful, try this:

rake -T pid

But your pid file appears to be in the log directory, not sure what is up with that.  If you can verify that mongrels are not running:

ps aux | grep mongrel 

Then you can delete the pid file manually:

rm log/mongrel*.pid

And one last thing regarding Keith's response.  I believe the mongrel pid file has the port number in the name, not the process identifier.  So if you have to kill mongrel manually you should pass "kill -9" the process identifier returned by "ps aux | grep mongrel".

Good luck, 
Lou 



On Tuesday,Oct 6, 2009, at 12:49PM, Keith wrote:

Steve -

I don't know how Mongrel deals with these, but I would imagine you could kill the process and delete the file.  If you're on Unix/Linux or OS X, you could:

ps aux | grep mongrel

This will show any running processes containing the name "mongrel".  One of them will be the grep itself.  Hopefully there will be another one including "3031".  You can terminate it like this:

kill [masked]

If Mongrel still won't start, it may be necessary to delete the PID file.  Try to find the file and manually delete it.  If you can't find it, open a terminal window and do:

find / -name mongrel.3031.pid 2>/dev/null

This might take a while, but should find it.

Good luck,
Keith


On Oct 6, 2009, at 12:39 PM, Steve wrote:

I know this is a simple question for you guys, but I am not a dev and my developer is not in yet.

I am trying to restart mongrels by running this: mongrel_rails cluster::start -C /home/urbis/apps/forum/config/mongrel_cluster.yml

I am getting this error:

** !!! PID file log/mongrel.3031.pid already exists.  Mongrel could be running already.  Check your log/mongrel.3031.log for errors.
** !!! Exiting with error.  You must stop mongrel and clear the .pid before I'll attempt a start.

I know there is away to clear stale PID files, but not sure how to do it.  Any advice would be great.

Thanks!

Steve

--
Steve Spurgat
Founder, CEO
Urbis Media
133 W 25th St # 6E
New York, NY 10001
http://www.urbis.com




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Steve ([address removed]) from NYC.rb - Ruby & Ruby on Rails Meetup.
To learn more about Steve, visit his/her member profile
To unsubscribe or to update your mailing list settings, click here

Meetup Support: [address removed]
632 Broadway, New York, NY 10012 USA





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Keith ([address removed]) from NYC.rb - Ruby & Ruby on Rails Meetup.
To learn more about Keith, visit his/her member profile
To unsubscribe or to update your mailing list settings, click here

Meetup Support: [address removed]
632 Broadway, New York, NY 10012 USA

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy