cap deploy:restart should be restarting your app so that it picks up the
new changes from the most recent deploy. I have no idea why it isn't.
What version of Capistrano are you using? How are you starting the mongrels?

- Jamis

On 2/15/09 1:02 PM, Greg Hauptmann wrote:
> (bump) Maybe I should confirm my basic understanding:
> 
> Question 1 - Is the idea that "cap deploy" should do a restart/refresh
> of your apps servers such as to enable the application changes? (I'm
> assuming yes here).  If not what is the minimum set of "cap ..." calls
> one would normally make to deploy/update/enable app changes.
> 
> Assuming the answer is 'yes', then I'm still stuck on this.  In short
> "cap deploy" is deploying the new application, trying to restart the
> application via reaper, however re enabling the new changes it is not
> working.  The issue is that whilst the "reaper" script is called, it
> just seems to restart the existing processes that themselves were tied
> to the "old" releases directly (as opposed to the newly created release
> "current" directory).  
> 
> Question 2 - How could I get my "cap deploy" script working right
> through to enabling the updating of my application changes (i.e.
> ensuring when it restarts my mongrel that it is associated with the
> latest releases "current" directory?   
> 
> I've had one suggestion on the rails list to: don't restart reaper,
> but: stop it, set symlink current, cd to current, start it.  However I'd
> prefer to understand from the Capistrano community whether what I have
> should already be working, or how Capistrano uses normally address this.
> 
> 
> Below is an example of the issue:
> 
> *** BEFORE CALLING REAPER ****
> [r...@home equity]# ps ax | grep -i ruby
> 12857 ?        S      0:02 ruby
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails start
> -d -a 0.0.0.0 -p 3001 -P
> /u/apps/equity/releases/20090209112325/tmp/pids/dispatch.3001.pid -e
> production -c /u/apps/equity/releases/20090209112325 -l
> /u/apps/equity/releases/20090209112325/log/mongrel.log
> 13036 pts/1    R+     0:00 grep -i ruby
> [r...@home equity]# cat current/tmp/pids/dispatch.3001.pid 
> 12857[r...@home equity]# ls -l
> total 2
> lrwxrwxrwx   1 root root   38 Feb 10 21:10 current ->
> /u/apps/equity/releases/20090210111005
> drwxrwxr-x  24 root root 1024 Feb 10 21:10 releases
> drwxrwxr-x   6 root root 1024 Feb  8 20:46 shared
> 
> *** CALL REAPER *** 
> [r...@home equity]# /u/apps/equity/current/script/process/reaper
> Restarting 12857
> 
> 
> *** AFTER CALLING REAPER *** 
> [r...@home equity]# ps ax | grep -i ruby
> 13043 ?        S      0:02 ruby
> /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails start
> -d -a 0.0.0.0 -p 3001 -P
> /u/apps/equity/releases/20090209112325/tmp/pids/dispatch.3001.pid -e
> production -c /u/apps/equity/releases/20090209112325 -l
> /u/apps/equity/releases/20090209112325/log/mongrel.log
> 13048 pts/1    R+     0:00 grep -i ruby
> [r...@home equity]# ls -l
> total 2
> lrwxrwxrwx   1 root root   38 Feb 10 21:10 current ->
> /u/apps/equity/releases/20090210111005  
> drwxrwxr-x  24 root root 1024 Feb 10 21:10 releases
> drwxrwxr-x   6 root root 1024 Feb  8 20:46 shared
> [r...@home equity]# cat current/tmp/pids/dispatch.3001.pid 
> 13043[r...@home equity]# 
> [r...@home equity]# 
> 
> 
> Regards
> Greg
> 
> 2008/9/8 greghauptmann <greg.hauptm...@gmail.com
> <mailto:greg.hauptm...@gmail.com>>
> 
> 
>     Hi,
> 
>     I've tracked my "cap deploy" problems down to the fact that (at least
>     with the unix user I've created for use with capistrano) when "script/
>     process/reaper" is run, whilst it restarts the ruby process the
>     resulting ruby process itself has a path that reflects the previous
>     "release" path, not the latest one that was put in place as a result
>     of capistrano.  Note that the link (created by ln ...etc) is correct,
>     so it seems "cap deploy" did it's job correctly except that the
>     "reaper" call when it restarts the ruby processes does use the latest
>     "current" path.   If I log onto the prod server with this user and
>     manually run "reaper" the same issue occurs.
> 
> 
>     Any ideas?
> 
>     === standard out ======
> 
>     Macintosh-2:myequity greg$ cap deploy --debug
>      * executing `deploy'
>      * executing `deploy:update'
>      ** transaction: start
>      * executing `deploy:update_code'
>      * executing "svn checkout -q  -r85
>     http://10.1.1.1:3690/svn/myequity/trunk
>     /u/apps/myequity/releases/20080908032908
>     <http://10.1.1.1:3690/svn/myequity/trunk
>     /u/apps/myequity/releases/20080908032908> && (echo 85 > /u/apps/
>     myequity/releases/20080908032908/REVISION)"
>     Preparing to execute command: svn checkout -q  -r85
>     http://10.1.1.1:3690/svn/myequity/trunk /u/apps/myequity/releases/
>     20080908032908 && (echo 85 > /u/apps/myequity/releases/20080908032908/
>     REVISION)
>     Execute ([Yes], No, Abort) ?  |y|  y
>        servers: ["10.1.1.1"]
>     Password:
>        [calla...@10.1.1.1 <mailto:calla...@10.1.1.1>] executing command
>        command finished
>      * executing `deploy:finalize_update'
>      * executing "chmod -R g+w /u/apps/myequity/releases/20080908032908"
>     Preparing to execute command: chmod -R g+w /u/apps/myequity/releases/
>     20080908032908
>     Execute ([Yes], No, Abort) ?  |y|  y
>        servers: ["10.1.1.1"]
>        [calla...@10.1.1.1 <mailto:calla...@10.1.1.1>] executing command
>        command finished
>      * executing "rm -rf /u/apps/myequity/releases/20080908032908/log /u/
>     apps/myequity/releases/20080908032908/public/system /u/apps/myequity/
>     releases/20080908032908/tmp/pids &&\n      mkdir -p /u/apps/myequity/
>     releases/20080908032908/public &&\n      mkdir -p /u/apps/myequity/
>     releases/20080908032908/tmp &&\n      ln -s /u/apps/myequity/shared/
>     log /u/apps/myequity/releases/20080908032908/log &&\n      ln -s /u/
>     apps/myequity/shared/system /u/apps/myequity/releases/20080908032908/
>     public/system &&\n      ln -s /u/apps/myequity/shared/pids /u/apps/
>     myequity/releases/20080908032908/tmp/pids"
>     Preparing to execute command:       rm -rf /u/apps/myequity/releases/
>     20080908032908/log /u/apps/myequity/releases/20080908032908/public/
>     system /u/apps/myequity/releases/20080908032908/tmp/pids &&
>          mkdir -p /u/apps/myequity/releases/20080908032908/public &&
>          mkdir -p /u/apps/myequity/releases/20080908032908/tmp &&
>          ln -s /u/apps/myequity/shared/log /u/apps/myequity/releases/
>     20080908032908/log &&
>          ln -s /u/apps/myequity/shared/system /u/apps/myequity/releases/
>     20080908032908/public/system &&
>          ln -s /u/apps/myequity/shared/pids /u/apps/myequity/releases/
>     20080908032908/tmp/pids
>     Execute ([Yes], No, Abort) ?  |y|  y
>        servers: ["10.1.1.1"]
>        [calla...@10.1.1.1 <mailto:calla...@10.1.1.1>] executing command
>        command finished
>      * executing "find /u/apps/myequity/releases/20080908032908/public/
>     images /u/apps/myequity/releases/20080908032908/public/stylesheets /u/
>     apps/myequity/releases/20080908032908/public/javascripts -exec touch -
>     t 200809080329.22 {} ';'; true"
>     Preparing to execute command: find /u/apps/myequity/releases/
>     20080908032908/public/images /u/apps/myequity/releases/20080908032908/
>     public/stylesheets /u/apps/myequity/releases/20080908032908/public/
>     javascripts -exec touch -t 200809080329.22 {} ';'; true
>     Execute ([Yes], No, Abort) ?  |y|  y
>        servers: ["10.1.1.1"]
>        [calla...@10.1.1.1 <mailto:calla...@10.1.1.1>] executing command
>        command finished
>      * executing `deploy:symlink'
>      * executing "rm -f /u/apps/myequity/current && ln -s /u/apps/
>     myequity/releases/20080908032908 /u/apps/myequity/current"
>     Preparing to execute command: rm -f /u/apps/myequity/current && ln -s /
>     u/apps/myequity/releases/20080908032908 /u/apps/myequity/current
>     Execute ([Yes], No, Abort) ?  |y|  y
>        servers: ["10.1.1.1"]
>        [calla...@10.1.1.1 <mailto:calla...@10.1.1.1>] executing command
>        command finished
>      ** transaction: commit
>      * executing `deploy:restart'
>      * executing "sudo -p 'sudo password: ' -u callagga /u/apps/myequity/
>     current/script/process/reaper"
>     Preparing to execute command: sudo -p 'sudo password: ' -u callagga /u/
>     apps/myequity/current/script/process/reaper
>     Execute ([Yes], No, Abort) ?  |y|  y
>        servers: ["10.1.1.1"]
>        [calla...@10.1.1.1 <mailto:calla...@10.1.1.1>] executing command
>     *** [err :: calla...@10.1.1.1 <mailto:calla...@10.1.1.1>]
>      ** [out :: calla...@10.1.1.1 <mailto:calla...@10.1.1.1>] Restarting
>     19776
>        command finished
>     Macintosh-2:myequity greg$
> 
>     ====================
> 
>     callagga 20557  2.8  5.3  29928 27112 ?        S    13:29   0:03 ruby /
>     usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails start -d -a
>     0.0.0.0 -p 3001 -P /u/apps/myequity/releases/20080908032044/tmp/pids/
>     dispatch.3001.pid -e production -c /u/apps/myequity/releases/
>     20080908032044 -l /u/apps/myequity/releases/20080908032044/log/
>     mongrel.log
>     =====================
> 
> 
> 
> 
> 
> 
> 
> -- 
> Greg
> http://blog.gregnet.org/
> 
> 
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to 
capistrano-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to