class InitExporter::Helpers::Init::SystemdBackend

Public Class Methods

new(ssh) click to toggle source
# File lib/init_exporter/helpers/init/systemd_backend.rb, line 7
def initialize(ssh)
  @ssh = ssh
end

Public Instance Methods

init_type() click to toggle source
# File lib/init_exporter/helpers/init/systemd_backend.rb, line 11
def init_type
  'systemd'
end
running?(job_name) click to toggle source
# File lib/init_exporter/helpers/init/systemd_backend.rb, line 23
def running?(job_name)
  @ssh.test :sudo, 'systemctl', 'status', job_name
end
start(job_name) click to toggle source
# File lib/init_exporter/helpers/init/systemd_backend.rb, line 15
def start(job_name)
  @ssh.execute :sudo, 'systemctl', 'start', job_name
end
stop(job_name) click to toggle source
# File lib/init_exporter/helpers/init/systemd_backend.rb, line 19
def stop(job_name)
  @ssh.execute :sudo, 'systemctl', 'stop', job_name
end