Restarting apps on reboot

i have an unbuntu server that i installed rails on using the free
peepcode screencast on deprec.

all is well unless the computer restarts. none of the apps come up on
their own, and if i try to restart them with capistrano, it tells me
that the old mongrel pids are still there and it cannot start.

right now i am manually having to go to each app and run rake
tmp:pids:clear and then restart the mongrel_cluster.

how can i get capistrano to clear these automatically, and what are my
options for starting apps when the server is rebooted and keeping them
running?

thanks

Josh K. wrote:

i have an unbuntu server that i installed rails on using the free
peepcode screencast on deprec.

all is well unless the computer restarts. none of the apps come up on
their own, and if i try to restart them with capistrano, it tells me
that the old mongrel pids are still there and it cannot start.

right now i am manually having to go to each app and run rake
tmp:pids:clear and then restart the mongrel_cluster.

how can i get capistrano to clear these automatically, and what are my
options for starting apps when the server is rebooted and keeping them
running?

I know next to nothing about Capistrano or linux, but I’m pretty sure
you can achieve your goal without Capistrano. I know, super helpful
right? Look on the bright side – posts with at least one reply
generally get more than posts with no replies. :slight_smile:

Also, this might help:
https://support.railsmachine.com/index.php?pg=kb.page&id=122

Well, I don’t use capistrano (although I really should start to) but I
have ran into the same problem myself and I run several RoR sites with
their own set of pid’s.

I have a script that on a reboot starts them all up and my only way
around it was to check if their were any PID fikes in the folder if
their are to just remove them and start things up I also cross
reference with ps to make sure it is not running but that is not
really needed as mongrel is pretty good at not starting up if
something is already running.

Nes++

Sent from my iPhone

Josh K. wrote:

i have an unbuntu server that i installed rails on using the free
peepcode screencast on deprec.

all is well unless the computer restarts. none of the apps come up on
their own, and if i try to restart them with capistrano, it tells me
that the old mongrel pids are still there and it cannot start.

right now i am manually having to go to each app and run rake
tmp:pids:clear and then restart the mongrel_cluster.

how can i get capistrano to clear these automatically, and what are my
options for starting apps when the server is rebooted and keeping them
running?

thanks

I imagine you have some scripts in /etc/init.d to bring the mongrels up?

By restart do you mean “Crash” (no shutdown invoked), or an ordinary
reboot (shutdown invoked)?

I have the problem for the “crash” case, with scripts in /etc/init.d to
bring up the mongrels. They do not get started, if the pid files are
still there.

Two possibilities mentioned on the web:

At http://rails.loglibrary.com/archives/2007/01/02

eureka: awesome. so only remaining thing is setup a rc.d startup file
that, when your machine reboots, finds .pid files and removes them.
01:56:31 zedas eureka: then you’re all set

At http://rubyforge.org/pipermail/mongrel-users/2007-March/003371.html
there is mention of “stale pid files” which might allow a “proper
solution”.

(This problem might be something for the mongrel mailing list.)

Stephan

Josh K. wrote:

i found what i needed here
http://paulgoscicki.com/archives/2008/03/mongrel_cluster-not-starting-after-hard-reboot/

just edited /etc/init.d/mongrel_cluster and added the --clean option
and everything works great!

Hey, thanks! Excellent.

Stephan

i found what i needed here
http://paulgoscicki.com/archives/2008/03/mongrel_cluster-not-starting-after-hard-reboot/

just edited /etc/init.d/mongrel_cluster and added the --clean option
and everything works great!

instead of usng capistrano at d start up.try usng mongrel-cluster as a
startup

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs