# "reaper" is not picking up new changes to my application?

**URL:** <https://www.ruby-forum.com/t/reaper-is-not-picking-up-new-changes-to-my-application/159831>\
**Category:** Rails\
**Created:** [February 9, 2009, 9:28am UTC](https://www.ruby-forum.com/t/reaper-is-not-picking-up-new-changes-to-my-application/159831 "2009-02-09T09:28:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [February 9, 2009, 9:28am UTC](https://www.ruby-forum.com/t/reaper-is-not-picking-up-new-changes-to-my-application/159831/1 "2009-02-09T09:28:49Z")

</div>

Hi,

Can anyone shed any light on why “reaper” (whilst seemingly working re  
restarting my mongrel ruby process) does not pick up changes to my  
application? (e.g. changing a title in a view for example). It’s like  
the  
“mongrel\_rails start etc…” is just restarting the current process but  
ignoring the new details re where the new application directory is.  
That  
is with capistrano the new releases are put in different directories,  
and  
are referenced in the command line options to “mongrel\_rails”, however  
it  
seems these are being picked up. I basically have to do a “reaper -a  
kill” and then a “nohup script/spin” to get it to recognize the new  
application directory.

Here’s an example of the scenario when I run reaper, the ruby processes  
is  
restarted, but it doesn’t pick up the new directory (i.e. application  
changes).

– CONSOLE OUTPUT —  
[root@home ~]# cd /u/apps/equity/current/  
[root@home current]# ./script/process/reaper  
Restarting 4453  
[root@home current]#

– MONGREL LOG EXTRACT –  
\*\* USR2 signal received.  
\*\* Restarting with arguments: 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/20090209050120/tmp/pids/dispatch.3001.pid -e  
production -c /u/apps/equity/releases/20090209050120 -l  
/u/apps/equity/releases/20090209050120/log/mongrel.log  
\*\* Daemonized, any open files are closed. Look at  
/u/apps/equity/releases/20090209050120/tmp/pids/dispatch.3001.pid and  
/u/apps/equity/releases/20090209050120/log/mongrel.log for info.  
\*\* Starting Mongrel listening at 0.0.0.0:3001  
\*\* Starting Rails with production environment…  
\*\* Rails loaded.  
\*\* Loading any Rails specific GemPlugins  
\*\* Signals ready. TERM =\> stop. USR2 =\> restart. INT =\> stop (no  
restart).  
\*\* Rails signals registered. HUP =\> reload (without restart). It might  
not  
work well.  
\*\* Mongrel 1.1.5 available at 0.0.0.0:3001  
\*\* Writing PID file to  
/u/apps/equity/releases/20090209050120/tmp/pids/dispatch.3001.pid

Thanks

–  
Greg  
[http://blog.gregnet.org/](http://blog.gregnet.org/)

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [February 9, 2009, 9:41am UTC](https://www.ruby-forum.com/t/reaper-is-not-picking-up-new-changes-to-my-application/159831/2 "2009-02-09T09:41:09Z")

</div>

i really don’t know about reaper (as i’m not using it), but i guess  
your problem is with the symlink “current”. you are calling reaper  
from that directory (in your example: /u/apps/equity/releases/  
20090209050120) and it does never leave it. as it seems you need to  
add some code/script to leave the current directory and reenter  
“current” after the symlink is updated.

from the top of my head i’ think about solving this with a simple  
rake- or capistrano-task.

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [February 9, 2009, 9:57am UTC](https://www.ruby-forum.com/t/reaper-is-not-picking-up-new-changes-to-my-application/159831/3 "2009-02-09T09:57:02Z")

</div>

I think I see what you’re getting at - this is actually the result of  
running the out of the box capistrano script - here’s the cap deploy  
output  
for example (I just wanted to make it simpler re my post)  
Macintosh-2:equity greg$ cap deploy -n

- executing `deploy’
- executing `deploy:update’  
\*\* transaction: start
- executing `deploy:update\_code’  
updating the cached checkout on all servers  
executing locally: “git ls-remote /Users/greg/source/equity/.git  
HEAD”
- executing “if [-d /u/apps/equity/shared/cached-copy]; then cd  
/u/apps/equity/shared/cached-copy && git fetch -q origin && git reset -q  
–hard 43f8b3df4d8f1f6358b803fbb41f38fcb1a9ddc4; else git clone -q  
[greg@10.1.1.102](mailto:greg@10.1.1.102):/Users/greg/source/equity/.git  
/u/apps/equity/shared/cached-copy && cd  
/u/apps/equity/shared/cached-copy &&  
git checkout -q -b deploy 43f8b3df4d8f1f6358b803fbb41f38fcb1a9ddc4; fi”  
copying the cached version to /u/apps/equity/releases/20090209085535
- executing “cp -RPp /u/apps/equity/shared/cached-copy  
/u/apps/equity/releases/20090209085535 && (echo  
43f8b3df4d8f1f6358b803fbb41f38fcb1a9ddc4 \>  
/u/apps/equity/releases/20090209085535/REVISION)”
- executing `deploy:finalize\_update’
- executing “chmod -R g+w /u/apps/equity/releases/20090209085535”
- executing “rm -rf /u/apps/equity/releases/20090209085535/log  
/u/apps/equity/releases/20090209085535/public/system  
/u/apps/equity/releases/20090209085535/tmp/pids &&\\n mkdir -p  
/u/apps/equity/releases/20090209085535/public &&\\n mkdir -p  
/u/apps/equity/releases/20090209085535/tmp &&\\n ln -s  
/u/apps/equity/shared/log /u/apps/equity/releases/20090209085535/log  
&&\\n  
ln -s /u/apps/equity/shared/system  
/u/apps/equity/releases/20090209085535/public/system &&\\n ln -s  
/u/apps/equity/shared/pids  
/u/apps/equity/releases/20090209085535/tmp/pids”
- executing “find /u/apps/equity/releases/20090209085535/public/images  
/u/apps/equity/releases/20090209085535/public/stylesheets  
/u/apps/equity/releases/20090209085535/public/javascripts -exec touch -t  
200902090855.35 {} ‘;’; true”
- executing `deploy:symlink’
- executing “rm -f /u/apps/equity/current && ln -s  
/u/apps/equity/releases/20090209085535 /u/apps/equity/current”  
\*\* transaction: commit
- executing `deploy:restart’
- executing “/u/apps/equity/current/script/process/reaper”  
Macintosh-2:equity greg$

2009/2/9 MaD [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> >

–  
Greg  
[http://blog.gregnet.org/](http://blog.gregnet.org/)

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [February 10, 2009, 12:37pm UTC](https://www.ruby-forum.com/t/reaper-is-not-picking-up-new-changes-to-my-application/159831/4 "2009-02-10T12:37:57Z")

</div>

Still stuck on this. I made sure I wasn’t in the “current” directory  
when I  
did the call to “reaper” and I still get the same result, i.e. whilst  
the  
process restarts it does not restart with the latest application updates  
(made available via the new application being put in a new “releases”  
directory, and then capistrano change the sym link for “current” to this  
new  
directory).

Question - Is a “reaper” restart action supposed to update an  
application?  
That is, is the out-of-the box Capistrano command  
“/u/apps/equity/current/script/process/reaper” really supposed to update  
any  
changes to an application (via a “cap deploy”)?

\*\*\* BEFORE CALLING REAPER \*\*\*\*  
[root@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  
[root@home equity]# cat current/tmp/pids/dispatch.3001.pid  
12857[root@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 \*\*\*  
[root@home equity]# /u/apps/equity/current/script/process/reaper  
Restarting 12857

\*\*\* AFTER CALLING REAPER \*\*\*  
[root@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  
[root@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  
[root@home equity]# cat current/tmp/pids/dispatch.3001.pid  
13043[root@home equity]#  
[root@home equity]#

Regards  
Greg

2009/2/9 Greg H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> - executing "if [-d /u/apps/equity/shared/cached-copy]; then cd
> - executing `deploy:finalize\_update’
> - executing "find /u/apps/equity/releases/20090209085535/public/images
> 
> > “current” after the symlink is updated.

–  
Greg  
[http://blog.gregnet.org/](http://blog.gregnet.org/)

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [February 14, 2009, 9:55pm UTC](https://www.ruby-forum.com/t/reaper-is-not-picking-up-new-changes-to-my-application/159831/5 "2009-02-14T21:55:34Z")

</div>

(bump) still really keen if someone has any info on this one (see below)

2009/2/10 Greg H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> changes to an application (via a “cap deploy”)?  
> [root@home equity]# cat current/tmp/pids/dispatch.3001.pid
> 
> total 2  
> Greg
> 
> > \*\* transaction: start
> > 
> > - executing "cp -RPp /u/apps/equity/shared/cached-copy  
> > /u/apps/equity/shared/log /u/apps/equity/releases/20090209085535/log &&\\n  
> > \*\* transaction: commit
> > 
> > > your problem is with the symlink “current”. you are calling reaper
> 
> [http://blog.gregnet.org/](http://blog.gregnet.org/)

–  
Greg  
[http://blog.gregnet.org/](http://blog.gregnet.org/)

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [February 15, 2009, 11:27am UTC](https://www.ruby-forum.com/t/reaper-is-not-picking-up-new-changes-to-my-application/159831/6 "2009-02-15T11:27:37Z")

</div>

don’t restart reaper, but:  
stop it,  
set symlink current,  
cd to current,  
start it.
