Class: Smartguard::Applications::Smartkiosk::Smartware

Inherits:
Process
  • Object
show all
Defined in:
lib/smartguard/applications/smartkiosk/smartware.rb

Instance Attribute Summary

Attributes inherited from Process

#path, #pid

Instance Method Summary collapse

Methods inherited from Process

#active?, #initialize, #wanted?

Constructor Details

This class inherits a constructor from Smartguard::Process

Instance Method Details

#startObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/smartguard/applications/smartkiosk/smartware.rb', line 5

def start
  super

  Logging.logger.info "Starting smartware"

  log_file    = @path.join('log/smartware.log')
  config_file = @path.join('config/services/smartware.yml')

  opts = []
  if Smartguard.environment == :production
    opts << "--log=#{log_file}"
  end

  if !run(@path, {}, "bundle", "exec", "smartware", "--config=#{config_file}", *opts)
    return false
  end

  without_respawn do
    wait_for_port 6001
  end
end

#stopObject



27
28
29
30
31
32
# File 'lib/smartguard/applications/smartkiosk/smartware.rb', line 27

def stop
  super

  Logging.logger.info "Stoping smartware"
  kill_and_wait :TERM, 15
end