mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 09:46:09 +02:00
Added que init script #2724
This commit is contained in:
parent
a2e6603ecc
commit
2324d08394
18 changed files with 178 additions and 293 deletions
5
lib/daemons/daemons
Executable file
5
lib/daemons/daemons
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env ruby
|
||||
results = []
|
||||
Dir[File.dirname(__FILE__) + "/*_ctl"].each {|f| results << `ruby #{f} #{ARGV.first}`}
|
||||
results.delete_if { |result| result.nil? || result.empty? }
|
||||
puts results.join unless results.empty?
|
17
lib/daemons/que.rb
Executable file
17
lib/daemons/que.rb
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
ENV["RAILS_ENV"] ||= "production"
|
||||
|
||||
root = File.expand_path(File.dirname(__FILE__))
|
||||
root = File.dirname(root) until File.exists?(File.join(root, 'config'))
|
||||
Dir.chdir(root)
|
||||
|
||||
require File.join(root, "config", "environment")
|
||||
|
||||
$running = true
|
||||
Signal.trap("TERM") do
|
||||
$running = false
|
||||
end
|
||||
|
||||
while($running) do
|
||||
end
|
6
lib/daemons/que_ctl
Executable file
6
lib/daemons/que_ctl
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env ruby
|
||||
require 'rubygems'
|
||||
require 'daemons/rails/config'
|
||||
|
||||
config = Daemons::Rails::Config.for_controller(File.expand_path(__FILE__))
|
||||
Daemons::Rails.run config[:script], config.to_hash
|
Loading…
Add table
Add a link
Reference in a new issue