#!/usr/bin/env ruby $:.unshift(File.join(File.dirname(__FILE__), "..", "lib")) require "poolparty" require "poolpartycl" available_monitors = PoolParty::Monitors.available_monitors o = PoolParty::Optioner.new(ARGV) do |opts, optioner| opts.on('-n name', '--name name', 'Host name') { |h| optioner.hostname h } opts.on('-l', '--no-shell', 'No shell') {optioner.noshell true} end load_pool(o.spec || Binary.get_existing_spec_location) include Remote @clouds = o.cloudname ? [cloud(o.cloudname.downcase.to_sym)] : clouds @hostname = o.hostname ? o.hostname : `hostname`.chomp @hostname = "node0" if @hostname == "master" # Quick fix to make sure we have a node running on the master as well @clouds.each do |name, cloud| with_cloud(cloud, {:testing => o.testing, :hostname => @hostname, :noshell => o.noshell }) do # TODO: Change this to be app specfic # SECURITY RISK boot_file = "#{Messenger.append_dir}/pm_node_rel-0.1" command = Messenger.erl_command(hostname, "-boot #{boot_file} #{noshell ? "" : "-detached -heart"}") Kernel.system command end end