Hey all, Has anyone out there got Mongrel deployments working with Capistrano? I''ve had a crack at setting it up, and I''ve found that after a deployment (with updated symlinks) that a mongrel restart does not pick up the new deployed site. It seems to me (in my linkted experience) that the HUP that is sent to mongrel does not re-evaluate the ./current symlink that Cap puts in to the appropriate release. If I do a mongrel restart from _outside_ the ./current dir by providing the -e option to mongrel, all is well. The result of all this is that a :restart from Capistrano that just sends a HUP is not effective, but I am not sufficiently familiar as yet with the pathing stuff in Cap to get it going another way. Anyway, if someone has some cleverness that I am missing, it would be greatly appreciated! Cheers, Dan
My understanding is summarized on the output Mongrel gives when you start it: ** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart). ** Rails signals registered. HUP => reload (without restart). On 4/18/06 11:52 PM, "Dan Sketcher" <dansketcher at gmail.com> wrote: HUP being a "reload" is done as a soft internal kind of thing, so if you''re moving directories around then it won''t pick that up. You want USR2. Zed> Hey all, > > Has anyone out there got Mongrel deployments working with Capistrano? > > I''ve had a crack at setting it up, and I''ve found that after a > deployment (with updated symlinks) that a mongrel restart does not > pick up the new deployed site. It seems to me (in my linkted > experience) that the HUP that is sent to mongrel does not re-evaluate > the ./current symlink that Cap puts in to the appropriate release. If > I do a mongrel restart from _outside_ the ./current dir by providing > the -e option to mongrel, all is well. The result of all this is that > a :restart from Capistrano that just sends a HUP is not effective, but > I am not sufficiently familiar as yet with the pathing stuff in Cap to > get it going another way. > > Anyway, if someone has some cleverness that I am missing, it would be > greatly appreciated! > > Cheers, > Dan > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users
Zed, I was getting some behaviour when using USR2 which seemed to terminate the daemon, but I''ll have another look at that and see how I go. Thanks for your help. Dan
Zed, Under Mongrel 0.3.12.4, on Ruby 1.8.4 1. If I start the daemon under the ./current directory, a USR2 does not pick up the change to the underlying symlink target. 2. If I start the daemon outside the ./current symlink (in the root of the project) passing the -c option, and then send a USR2, the daemon terminates without saying anything to the console or to the log. --- snip --- # mongrel_rails start -d -p 8001 -c current -e production -P log/mongrel-1.pid ** Starting Mongrel in production mode at 0.0.0.0:8001 ** Daemonizing, any open files are closed. Look at log/mongrel-1.pid and log/mongrel.log for info. # ps aux | grep mongrel root 7706 68.5 10.4 22868 19868 ? S 19:55 0:02 /usr/bin/ruby18 /usr/bin/mongrel_rails start -d -p 8001 -c current -e production -P log/mongrel-1.pid root 7708 0.0 0.2 1536 496 pts/1 S+ 19:55 0:00 grep mongrel # kill -USR2 7706 # ps aux | grep mongrel root 7710 0.0 0.2 1540 492 pts/1 R+ 19:55 0:00 grep mongrel --- /snip --- Any ideas? Cheers, Dan
Hmmm, let me see what''s up. I may have to finally setup Capistrano and get it all working. Bah. Make me do work. :-) Zed On 4/19/06 5:59 AM, "Dan Sketcher" <dansketcher at gmail.com> wrote:> Zed, > > Under Mongrel 0.3.12.4, on Ruby 1.8.4 > > 1. If I start the daemon under the ./current directory, a USR2 does > not pick up the change to the underlying symlink target. > > 2. If I start the daemon outside the ./current symlink (in the root of > the project) passing the -c option, and then send a USR2, the daemon > terminates without saying anything to the console or to the log. > > --- snip --- > # mongrel_rails start -d -p 8001 -c current -e production -P log/mongrel-1.pid > ** Starting Mongrel in production mode at 0.0.0.0:8001 > ** Daemonizing, any open files are closed. Look at log/mongrel-1.pid > and log/mongrel.log for info. > # ps aux | grep mongrel > root 7706 68.5 10.4 22868 19868 ? S 19:55 0:02 > /usr/bin/ruby18 /usr/bin/mongrel_rails start -d -p 8001 -c current -e > production -P log/mongrel-1.pid > root 7708 0.0 0.2 1536 496 pts/1 S+ 19:55 0:00 grep mongrel > # kill -USR2 7706 > # ps aux | grep mongrel > root 7710 0.0 0.2 1540 492 pts/1 R+ 19:55 0:00 grep mongrel > --- /snip --- > > Any ideas? > > Cheers, > Dan > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users