Reaper is not restarting mongrel with the latest release path? (but rather an earlier releases path

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?

Also, I can’t quite see in the reaper code in rails how it actually
repopulates the PID file with the new PID number after a restart? Does
mongrel itself do this when it received the “kill -s USR2”?

=== 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 && (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:
    [[email protected]] 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”]
    [[email protected]] 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”]
    [[email protected]] 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”]
    [[email protected]] 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”]
    [[email protected]] 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”]
    [[email protected]] executing command
    *** [err :: [email protected]]
    ** [out :: [email protected]] 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

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