Odd behavior when started with unix exec command

16 views
Skip to first unread message

Cyle Hunter

unread,
Oct 27, 2014, 8:51:08 PM10/27/14
to queue_...@googlegroups.com
I'm trying to start my qc workers using the runit init system on linux. Here's the script I'm using:


#!/bin/bash
cd
/var/www/mysite.com/current

echo
"Service PID: $$"

export PATH="/usr/local/rvm/bin:$PATH"
export rvm_user_install_flag=1
export rvm_trust_rvmrcs=1
export rvm_trust_rvmrcs_flag=1

source
/usr/local/rvm/scripts/rvm
exec bundle exec rake qc:work RAILS_ENV="production" QUEUES="default,mailers"


When I start the service using runit's  sv program (i.e., `sv start service`) I can see rake task running with the new PID. However, as new jobs get added to the queue they only seem to execute after I invoke `sv down service`, which according to their [manual](marden.org/runit/sv.8.html), sends the `TERM` & `CONT` signals.

I'm looking through the source code and comparing it to delayed_job which seems to accommodate the `exec` command on it's rake task. But I'm not knowledgeable enough to come to any conclusions, hopefully somebody else can chime in here or point me in the right direction.

Cyle Hunter

unread,
Oct 27, 2014, 8:55:30 PM10/27/14
to queue_...@googlegroups.com
Ignore my failed attempt to use markdown in google groups.... lol
Message has been deleted

Cyle Hunter

unread,
Oct 28, 2014, 3:56:20 PM10/28/14
to queue_...@googlegroups.com
After I turned on debugging I could see that the jobs were being processed correctly after all, I was testing with a job that simply put a message to stdout. Using the DEBUG="true" option with the rake task does the trick. Using p instead of puts also seems to work.
Reply all
Reply to author
Forward
0 new messages