Sha256: ecbffd9a724bd14f20dddc86726fefa79b86ad2f6aea0bfff09c8e71e11e4540

Contents?: true

Size: 1.35 KB

Versions: 2

Compression:

Stored size: 1.35 KB

Contents

namespace :backgroundjob do
  
  namespace :centos do
    
    desc <<-DESC
    Setup backgroundjob for application.
    
    "Source":#{link_to_source(__FILE__)}
    DESC
    task_arg(:backgroundjob_bin_path, "Path to backgroundjob", 
      :default => Proc.new{"#{current_path}/script/bj run --forever --rails_env=production --rails_root=#{current_path} --redirect=#{backgroundjob_log_path} --log=#{backgroundjob_log_path} --pidfile=#{backgroundjob_pid_path} --daemon"},
      :default_desc => "\#{current_path}/script/bj run --forever --rails_env=production --rails_root=\#{current_path} --redirect=\#{backgroundjob_log_path} --log=\#{backgroundjob_log_path} --pidfile=\#{backgroundjob_pid_path} --daemon")
    task_arg(:backgroundjob_pid_path, "Path to backgroundjob pid file", :default => Proc.new{"#{shared_path}/pids/bj.pid"}, :default_desc => "\#{shared_path}/pids/bj.pid")
    task_arg(:backgroundjob_log_path, "Path to backgroundjob log file", :default => Proc.new{"#{shared_path}/log/bj.log"}, :default_desc => "\#{shared_path}/log/bj.log")    
    task :setup do       
      
      # Install initscript      
      utils.install_template("backgroundjob/backgroundjob.initd.centos.erb", "/etc/init.d/backgroundjob_#{application}")

      # Enable service
      run_via "/sbin/chkconfig --level 345 backgroundjob_#{application} on"    
      
    end
    
  end
  
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
calas-capitate-0.3.6 lib/recipes/centos/backgroundjob.rb
capitate-0.3.6 lib/recipes/centos/backgroundjob.rb