Sha256: 2aeeae08bfba27ad417c61a71c4d528df9b51519f8fefb121dd3ced393fa9951

Contents?: true

Size: 1.23 KB

Versions: 44

Compression:

Stored size: 1.23 KB

Contents

#!/usr/bin/env ruby
$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "poolparty"
require "poolpartycl"

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

available_monitors = PoolParty::Monitors.available_monitors

@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

o.loaded_clouds.each do |cloud|
  
  with_cloud(cloud, {:hostname => @hostname}) do
    # TODO: Change this to be app specfic    
    already_running = %x[ps aux | grep beam | grep -v grep | grep node]
    if already_running.chomp.empty?    
      boot_file = "#{Messenger.append_dir}/pm_node_rel-0.1"

      Kernel.system ". /etc/profile && server-build-messenger"  unless ::File.file?("#{boot_file}.boot") || testing
      command = Messenger.erl_command(hostname, "-boot #{boot_file} #{noshell ? "" : "-noshell -detached -heart"} -- #{available_monitors.join(" ")}")    
      vputs "Running #{command}"
      
      Kernel.system "export HOME=/root && #{command}" unless testing
    end
  end  
  
end

Version data entries

44 entries across 44 versions & 3 rubygems

Version Path
auser-poolparty-0.2.54 bin/server-start-node
auser-poolparty-0.2.55 bin/server-start-node
auser-poolparty-0.2.56 bin/server-start-node
auser-poolparty-0.2.57 bin/server-start-node
auser-poolparty-0.2.58 bin/server-start-node
auser-poolparty-0.2.59 bin/server-start-node
auser-poolparty-0.2.60 bin/server-start-node
auser-poolparty-0.2.61 bin/server-start-node
auser-poolparty-0.2.62 bin/server-start-node
auser-poolparty-0.2.63 bin/server-start-node
auser-poolparty-0.2.64 bin/server-start-node
auser-poolparty-0.2.65 bin/server-start-node
auser-poolparty-0.2.66 bin/server-start-node
auser-poolparty-0.2.67 bin/server-start-node
auser-poolparty-0.2.68 bin/server-start-node
auser-poolparty-0.2.69 bin/server-start-node
auser-poolparty-0.2.70 bin/server-start-node
auser-poolparty-0.2.71 bin/server-start-node
auser-poolparty-0.2.72 bin/server-start-node
auser-poolparty-0.2.74 bin/server-start-node