Class: Daemon::Command::StatusCommand

Inherits:
BaseCommand show all
Defined in:
lib/onapp/engine/command/status_command.rb

Overview

Used to show status of onapp-engine service

Instance Attribute Summary

Attributes inherited from BaseCommand

#options

Attributes included from UserInterface

#err, #out

Instance Method Summary (collapse)

Methods inherited from BaseCommand

#initialize

Methods included from UserInterface

#error, #say

Constructor Details

This class inherits a constructor from Daemon::Command::BaseCommand

Instance Method Details

- (Object) execute

Entry point



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/onapp/engine/command/status_command.rb', line 10

def execute
  if engine_pid
    say "#{Daemon::MasterProcess::PROCESS_NAME} is running (pid #{engine_pid})"
  else
    say "#{Daemon::MasterProcess::PROCESS_NAME} is stopped"
  end

  if worker_pids.count > 0
    say "#{Daemon::PROCESS_NAME} is running (pids #{worker_pids.join(', ')})"
    return true
  else
    say "#{Daemon::PROCESS_NAME} is stopped"
    return false
  end
end