#!/usr/bin/env ruby if !ENV['BACKGROUND'].nil? if RUBY_VERSION < "1.9" exit if fork Process.setsid exit if fork Dir.chdir "/" STDIN.reopen "/dev/null" STDOUT.reopen "/dev/null", "a" STDERR.reopen "/dev/null", "a" else Process.daemon end end Dir.chdir(File.join("/home", "ubuntu")) require 'drb/drb' require 'drb/acl' require 'cucumber-chef' require 'cucumber/chef/helpers' class FrontObject attr_accessor :servers include Cucumber::Chef include Cucumber::Chef::Helpers def initialize tag = Cucumber::Chef.tag("cc-server") puts(" * #{tag}") Cucumber::Chef.load_config(tag) $logger = Cucumber::Chef.logger end def shutdown DRb.stop_service end def logger $logger end end list = %w( deny all ) ARGV[0] and (list += [ 'allow', ARGV[0] ]) acl = ACL.new(list) # This will break everything: # $SAFE = 1 DRb.start_service("druby://:8787", FrontObject.new) DRb.thread.join