class Zlown::Systemctl

Public Class Methods

disable(args = [], opts = {}) click to toggle source
# File lib/zlown/systemctl/systemctl.rb, line 18
def self.disable(args = [], opts = {})
  puts 'Disabling systemctl service'
  cmd = "systemctl disable #{Zlown::Config::ZLOWN_SERVICE_NAME}"
  system cmd
end
enable(args = [], opts = {}) click to toggle source
# File lib/zlown/systemctl/systemctl.rb, line 11
def self.enable(args = [], opts = {})
  puts 'Enabling systemctl service'
  cmd = "systemctl enable #{Zlown::Config::ZLOWN_SERVICE_FILE}"
  puts cmd
  system cmd
end
log(args = [], opts = {}) click to toggle source
# File lib/zlown/systemctl/systemctl.rb, line 41
def self.log(args = [], opts = {})
  cmd = "journalctl -u #{Zlown::Config::ZLOWN_SERVICE_NAME}"
  system cmd
end
start(args = [], opts = {}) click to toggle source
# File lib/zlown/systemctl/systemctl.rb, line 24
def self.start(args = [], opts = {})
  puts 'Starting systemctl service'
  cmd = "systemctl start #{Zlown::Config::ZLOWN_SERVICE_NAME}"
  system cmd
end
status(args = [], opts = {}) click to toggle source
# File lib/zlown/systemctl/systemctl.rb, line 36
def self.status(args = [], opts = {})
  cmd = "systemctl status #{Zlown::Config::ZLOWN_SERVICE_NAME}"
  system cmd
end
stop(args = [], opts = {}) click to toggle source
# File lib/zlown/systemctl/systemctl.rb, line 30
def self.stop(args = [], opts = {})
  puts 'Stopping systemctl service'
  cmd = "systemctl stop #{SERVICE_NAME}"
  system cmd
end