-
-
Save agibralter/113918 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'daemons' | |
# This is a bit hacky, but we don't have a clean way to hook into the parsed | |
# options, as Daemons is managing these internally. | |
number = 0 | |
for i in 0..ARGV.length | |
if ARGV[i] == '--number' | |
number = ARGV[i + 1] | |
2.times {ARGV.delete_at(i)} | |
end | |
end | |
puts "Workling Number: #{number}" | |
workling = File.join(File.dirname(__FILE__), '..', 'vendor', 'plugins', 'workling', 'script', 'listen.rb') | |
options = { | |
:app_name => "workling#{number}", | |
:ARGV => ARGV, | |
:dir_mode => :normal, | |
:dir => File.join(File.dirname(__FILE__), '..', 'log'), | |
:log_output => true, | |
:multiple => false, | |
:backtrace => true, | |
:monitor => false | |
} | |
Daemons.run(workling, options) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment