Class: Bosh::Agent::Runner

Inherits:
Object show all
Defined in:
lib/bosh_agent/runner.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRunner

Returns a new instance of Runner.



8
9
10
# File 'lib/bosh_agent/runner.rb', line 8

def initialize
  @logger = Config.logger
end

Class Method Details

.run(options) ⇒ Object



3
4
5
6
# File 'lib/bosh_agent/runner.rb', line 3

def self.run(options)
  Config.setup(options)
  Runner.new.start
end

Instance Method Details

#startObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/bosh_agent/runner.rb', line 12

def start
  $stdout.sync = true
  @logger.info("Starting agent #{VERSION}...")

  @logger.info('Configuring agent...')
  Bootstrap.new.configure

  if Config.configure
    Monit.enable
    Monit.start
    Monit.start_services
  end

  if Config.mbus.start_with?('https')
    @logger.info('Starting up https agent')
    require 'bosh_agent/http_handler'
    HTTPHandler.start
  else
    Handler.start
  end
end