class Conjure::DelayedJob

Public Class Methods

new(options) click to toggle source
# File lib/conjure/delayed_job.rb, line 3
def initialize(options)
  @rails_env = options[:rails_env]
end

Public Instance Methods

apply(template) click to toggle source
# File lib/conjure/delayed_job.rb, line 7
def apply(template)
  template.add_file_data monit_rc, "/etc/monit/monitrc"
  template.run "chmod 0600 /etc/monit/monitrc"
  template.add_file_data monit_run, "/etc/service/monit/run"
  template.run "chmod 0700 /etc/service/monit/run"
end
system_packages() click to toggle source
# File lib/conjure/delayed_job.rb, line 14
def system_packages
  ["monit"]
end

Private Instance Methods

monit_rc() click to toggle source
# File lib/conjure/delayed_job.rb, line 20
    def monit_rc
      command = "/usr/bin/env RAILS_ENV=#{@rails_env} /home/app/application/current/bin/delayed_job"
      'set daemon 10
set logfile /var/log/monit.log
set idfile /var/lib/monit/id
set statefile /var/lib/monit/state
check process delayed_job
  with pidfile /home/app/application/shared/tmp/pids/delayed_job.pid
  start program = "' + command + ' start" as uid "app" and gid "app"
  stop program = "' + command + ' stop" as uid "app" and gid "app"
'
    end
monit_run() click to toggle source
# File lib/conjure/delayed_job.rb, line 33
    def monit_run
      '#!/bin/sh
exec /usr/bin/monit -I
'
    end