Sha256: 86d7605839b385aa14b1f0108823c021e495773f6a4b3fe85b767c69cb9a7938
Contents?: true
Size: 1.24 KB
Versions: 4
Compression:
Stored size: 1.24 KB
Contents
#!/usr/bin/env ruby $: << File.dirname(__FILE__) + '/../lib' unless $:.include?(File.dirname(__FILE__) + '/../lib/') require 'rubygems' require 'daemons' require 'fileutils' require 'flapjack/cli/notifier_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 = Flapjack::NotifierManagerOptions.parse(args) worker_path = File.join(File.dirname(__FILE__), 'flapjack-notifier') # set up pid dir pid_dir = "/var/run/flapjack/" unless File.exists?(pid_dir) puts "#{pid_dir} doesn't exist." exit 2 end unless File.writable?(pid_dir) puts "Can't write to #{pid_dir} - check permissions?" exit 2 end # construct arguments daemon_args = args if args.first != "stop" # if we're not stopping the daemon, pass options to it daemon_args += ['--', '--beanstalk', options.host, '--port', options.port.to_s, '--recipients', options.recipients, '--config', File.expand_path(options.config_filename)] end # boot Daemons.run(worker_path, :ARGV => daemon_args, :multiple => false, :dir_mode => :normal, :dir => pid_dir)
Version data entries
4 entries across 4 versions & 2 rubygems