Sha256: 6783e317cecfd21da06468045e27e2f07f8ad983ded49bda439a4dd6239a2b97
Contents?: true
Size: 902 Bytes
Versions: 7
Compression:
Stored size: 902 Bytes
Contents
#!/usr/bin/env ruby $: << File.dirname(__FILE__) + '/../lib' unless $:.include?(File.dirname(__FILE__) + '/../lib/') require 'rubygems' require 'daemons' require 'fileutils' require 'flapjack/cli/worker_manager' require 'flapjack/patches' # for Daemons # reassign ARGV so we don't mess with it directly args = ARGV args << '--help' if args.size == 0 options = WorkerManagerOptions.parse(args) worker_path = File.join(File.dirname(__FILE__), 'flapjack-worker') # set up pid dir pid_dir = "/var/run/flapjack" FileUtils.mkdir_p(pid_dir) # spin up a number of workers (5 is the default). options.workers.times do |n| # we fork for each worker, as Daemons.run backgrounds this script. fork do Daemons.run(worker_path, :ARGV => (args + %w(-- -b localhost)), :multiple => true, :dir_mode => :normal, :dir => pid_dir) end end
Version data entries
7 entries across 7 versions & 1 rubygems