#!/usr/bin/env ruby 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 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 knife_rb = Cucumber::Chef.locate(:file, ".chef", "knife.rb") Chef::Config.from_file(knife_rb) end def shutdown DRb.stop_service end end hostname = %x( hostname -f ).chomp list = %w( deny all allow 127.0.0.1 ) 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