OK turns out I have been looking at this all wrong. When dealing with
rails applications running with passenger the idea is that your web-
server is running outside your application domain. This is a good
thing as you restart passenger and not the entire web server. Once you
restart passenger the new code will be loaded. This is great if you
have other sites runnning in nginx as I do. This also allows for your
deployment user not to have any sudo as it does not even care what web
server is running. To restart passenger for your application use the
following command.
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{File.join(current_path,'tmp','restart.txt')}"
end
Note that the file your dealing with is inside your app :). I have
taken all sudo access away form my deployment user. (helps me sleep at
night).
I felt a little sheepish when I found this out but here is the
solution for anyone thats having trouble.
On Sep 13, 10:32 pm, Aaron Starr <[email protected]> wrote:
> I'm using capistrano with nginx and haven't had any problems that needed
> working around. My versions are probably a bit old, as I'm on the
> if-it-ain't-broke-don't-fix-it update program at the moment.
>
> astarr:~$ cap --version
> Capistrano v2.5.2
> astarr:~$ ruby --version
> ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
>
> ast...@achilles:~$ /usr/sbin/nginx -v
> nginx version: nginx/0.7.59
>
> My deploy.rb file has this:
>
> default_run_options[:pty] = true
>
> [...]
>
> namespace :deploy do
> namespace :web do
> task :start, :roles => :web do
> sudo "/etc/init.d/nginx start"
> end
> task :stop, :roles => :web do
> sudo "/etc/init.d/nginx stop"
> end
> task :restart, :roles => :web do
> sudo "/etc/init.d/nginx restart"
> end
>
> [...]
>
>
>
> On Mon, Sep 13, 2010 at 2:00 PM, Stewart <[email protected]> wrote:
> > Well with no answer to this in the passenger group I am still stuck.
> > Looks like I don't have any way to restart the server with cap. Surely
> > someone is running nginx with cap and has this task working. Let me
> > know if you do. I would love to hear how you have done it.
>
> > On Sep 10, 10:32 am, Lee Hambley <[email protected]> wrote:
> > > Cool guys, thanks for what's turning out to be a really useful thread!
>
> > --
> > * You received this message because you are subscribed to the Google Groups
> > "Capistrano" group.
> > * To post to this group, send email to [email protected]
> > * To unsubscribe from this group, send email to
> > [email protected]<capistrano%2bunsubscr...@googlegrou
> > ps.com>For more options, visit this group at
> >http://groups.google.com/group/capistrano?hl=en
--
* You received this message because you are subscribed to the Google Groups
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/capistrano?hl=en