Tag Archives: Resque

Gitorious & Resque

As I’ve mentioned in previous posts, I’ve had problems with resque, as it’s currently set up, running as its supposed to on Centos 6.5. I can see the application active if I check for it:

[root@srv-git-01 ~]# ps -ef | grep "resque"                                     
root     27821     1  0 13:14 ?        00:00:00 /bin/bash -i -l -c chruby ruby- && /var/www/gitorious/app/bin/rake resque:work QUEUE=*
git      27850 27821 77 13:14 ?        00:00:02 ruby /var/www/gitorious/app/bin/rake resque:work QUEUE=*
root     27853  7112  0 13:14 pts/0    00:00:00 grep resque

But it isn’t doing the work it’s supposed to: I manually have to run the command for new repositories to be created, and updates from users don’t show up on the website until I run resque manually.

I now have a way to make it work. I kill the above processes that are running. I su to the Gitorious user, git, in our case, and run the command from the Upstart file from the command line:

-bash-4.1$ chruby-exec ruby- — bin/rake resque:work QUEUE=*

I again ‘ps’ to find the running process:

root@srv-git-01 ~]# ps -ef | grep "resque"                                     
git      33861 33601  0 13:22 pts/0    00:00:00 /bin/bash -i -l -c chruby ruby- && bin/rake resque:work QUEUE=*
git      33889 33861 56 13:22 pts/0    00:00:13 ruby bin/rake resque:work QUEUE=*
root     33931 33903  0 13:22 pts/1    00:00:00 grep resque

I kill the parent process, in this case 33861:

[root@srv-git-01 ~]# kill -9 33861
[root@srv-git-01 ~]# ps -ef | grep "resque"
git      33889     1 62 13:22 pts/0    00:00:26 resque-1.24.1: Waiting for *     
root     34055 33903  0 13:23 pts/1    00:00:00 grep resque

Now the child process is running and, as you can see from the second check, it’s in a ‘waiting’ state. And, in this state, it is working as I had expected it to.

I still haven’t figured out how to do this to run correctly at start. That’s the next step.

As an aside, when doing my latest search on this topic, I discovered that Upstart is going away:


I haven’t done more research to find out why. But maybe the alternative will solve my problem.