Skip to content

Debugging_Conductor_(production)

Matt Wagner edited this page Oct 25, 2012 · 1 revision

Debugging Conductor (production)

_I recently was trying to track down an issue that jclift was seeing in his environment, and really wanted to see what was going on line by line.
And really didn’t want to add a million print statements only to have to figure out which of the seven log files I need to monitor to see the output.
(This assumes your environment is installed via RPMs.)_

Enter ruby-debug. First though, I had to be able to run the processes in the foreground and not as services.

Preamble

  1. yum install rubygem-ruby-debug -y
  2. add “gem ruby-debug” to the default section of /usr/share/aeolus-conductor/Gemfile.in

Run Aeolus Conductor in the foreground:

  1. Create a /bin\ directory
    #\ cp\ /etc/init.d/aeolus-conductor
    /bin
  2. reduce the /bin/aeolus-conductor\ file\ to\ loading\ external\ vars\ and\ running\ thin\ .
    The\ up\ to\ date\ startup\ script\ is\ available\ here:\
    <pre>
    https://github.com/aeolusproject/aeolus-extras/tree/master/debugging_aeolus
    </pre>
    For\ anyone\ needing\ that\ startup\ script,\ run\ this\ to\ pull\ it\ down\ from\ the\ command\ line:
    <pre>
    $\ wget\ https://github.com/aeolusproject/aeolus-extras/raw/master/debugging_aeolus/aeolus-conductor
    </pre>
    #\ chmod\ 755
    /bin/aeolus-conductor
  3. service aeolus-conductor stop
  4. aeolus-conductor

Run delayed_job in the foreground:

  1. cd /usr/share/aeolus-conductor
  2. RAILS_ENV=production rake jobs:work

Now, if you add the word “debugger” (which adds a breakpoint for rdebug) to any ruby file under /usr/share/aeolus-conductor/app, you should hit
the breakpoint in either conductor or delayed_job. Now you can do all the fancy debugging that you like.

Clone this wiki locally