staugaard-cloudmaster 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/VERSION.yml +1 -1
  2. data/app/pool_runner.rb +0 -3
  3. data/bin/cloudmaster +39 -30
  4. metadata +13 -4
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 1
4
- :patch: 4
4
+ :patch: 5
data/app/pool_runner.rb CHANGED
@@ -20,9 +20,6 @@ module Cloudmaster
20
20
  def initialize(config)
21
21
  @config = config
22
22
  @pool_managers = []
23
- Signal.trap("INT") do
24
- self.shutdown
25
- end
26
23
  end
27
24
 
28
25
  # Create each of the pool managers described in the configuration.
data/bin/cloudmaster CHANGED
@@ -1,45 +1,54 @@
1
1
  #!/usr/bin/ruby
2
2
  $:.unshift File.expand_path('../app', File.dirname(__FILE__))
3
3
 
4
+ require 'rubygems'
5
+ require 'daemons'
4
6
  require 'configuration'
5
7
  require 'aws_context'
6
8
  require 'configuration'
7
9
  require 'pool_runner'
8
10
  require 'pp'
9
11
 
10
- # Get optional args specifying what server to manage.
11
- verbose = false
12
- config_files = []
13
- opts = []
14
- args = ARGV
15
- while args.size > 0
16
- a = args.shift
17
- case a
18
- when "-?": puts "usage: cloudmaster [-v] [-l logfile] [-c configfile] [-p pool]"
19
- exit 1
20
- when "-v": verbose = true
21
- when "-l": logfile = args.shift
22
- when "-c": config_files << args.shift
23
- when "-p": opts << args.shift.to_sym
12
+ options = {
13
+ :dir_mode => :system,
14
+ :multiple => false,
15
+ :ontop => false,
16
+ :mode => :load,
17
+ :backtrace => true,
18
+ :monitor => false,
19
+ :log_output => true,
20
+ }
21
+
22
+ Daemons.run_proc('cloudmaster', options) do
23
+ # Get optional args specifying what server to manage.
24
+ verbose = false
25
+ config_files = []
26
+ opts = []
27
+ args = ARGV
28
+ while args.size > 0
29
+ a = args.shift
30
+ case a
31
+ when "-?": puts "usage: cloudmaster [-v] [-l logfile] [-c configfile] [-p pool]"
32
+ exit 1
33
+ when "-v": verbose = true
34
+ when "-l": logfile = args.shift
35
+ when "-c": config_files << args.shift
36
+ when "-p": opts << args.shift.to_sym
37
+ end
24
38
  end
25
- end
26
- opts.uniq!
39
+ opts.uniq!
27
40
 
28
- LoggerFactory.setup(logfile, 'cloudmaster')
29
- AwsContext.setup(:retry)
41
+ LoggerFactory.setup(logfile, 'cloudmaster')
42
+ AwsContext.setup(:retry)
30
43
 
31
- config = Cloudmaster::Configuration.new(config_files, opts)
44
+ config = Cloudmaster::Configuration.new(config_files, opts)
32
45
 
33
- if verbose
34
- puts "Environment: #{config.aws[:aws_env]}" if config.aws[:aws_env]
35
- puts "Log file: #{logfile}" if logfile
36
- puts "Config file: #{config_files.join(' ')}" if config_files.size > 0
37
- end
46
+ if verbose
47
+ puts "Environment: #{config.aws[:aws_env]}" if config.aws[:aws_env]
48
+ puts "Log file: #{logfile}" if logfile
49
+ puts "Config file: #{config_files.join(' ')}" if config_files.size > 0
50
+ end
38
51
 
39
- Signal.trap("TERM") do
40
- # re-read the config file on SIGTERM -- into existing config object
41
- config.refresh
52
+ # Run a pool supervisor
53
+ Cloudmaster::PoolRunner.new(config).run
42
54
  end
43
-
44
- # Run a pool supervisor
45
- Cloudmaster::PoolRunner.new(config).run
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: staugaard-cloudmaster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - cchayden
@@ -11,10 +11,19 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2009-04-20 00:00:00 -07:00
14
+ date: 2009-04-22 00:00:00 -07:00
15
15
  default_executable: cloudmaster
16
- dependencies: []
17
-
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ name: daemons
19
+ type: :runtime
20
+ version_requirement:
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: 1.0.10
26
+ version:
18
27
  description:
19
28
  email: mick@staugaard.com
20
29
  executables: