module Luban::Deployment::Packages::Grafana::Controller::Commands

Public Class Methods

included(base) click to toggle source
# File lib/luban/deployment/packages/grafana/controller.rb, line 7
def self.included(base)
  base.define_executable 'grafana-server'
end

Public Instance Methods

process_pattern() click to toggle source
# File lib/luban/deployment/packages/grafana/controller.rb, line 11
def process_pattern
  @process_pattern ||= "\\-config #{control_file_path}$"
end
shell_setup() click to toggle source
Calls superclass method
# File lib/luban/deployment/packages/grafana/controller.rb, line 15
def shell_setup
  @shell_setup ||= super << "cd #{install_path}"
end
start_command() click to toggle source
# File lib/luban/deployment/packages/grafana/controller.rb, line 19
def start_command
  @start_command ||= shell_command("#{grafana_server_executable} -pidfile #{pid_file_path} -config #{control_file_path}", output: nil) + ' &'
end
stop_command() click to toggle source
# File lib/luban/deployment/packages/grafana/controller.rb, line 23
def stop_command
  @stop_command ||= shell_command("kill $(cat #{pid_file_path} 2>/dev/null)")
end