Sha256: 53d45ff67ee58b1dcedc9d7260f95edfc80adb598c06af6c1694cc03349aa954

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 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

daemon_args = (args + ['--', '--beanstalk', options.host, 
                       '--port', options.port.to_s,
                       '--recipients', options.recipients])

Daemons.run(worker_path, :ARGV => daemon_args,
                         :multiple => false, 
                         :dir_mode => :normal,
                         :dir => pid_dir)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
auxesis-flapjack-0.4.8 bin/flapjack-notifier-manager
auxesis-flapjack-0.4.9 bin/flapjack-notifier-manager