Class: Zlown::Systemctl

Inherits:
Object
  • Object
show all
Defined in:
lib/zlown/systemctl/systemctl.rb

Class Method Summary collapse

Class Method Details

.disable(args = [], opts = {}) ⇒ Object



18
19
20
21
22
# 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 = {}) ⇒ Object



11
12
13
14
15
16
# 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 = {}) ⇒ Object



41
42
43
44
# 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 = {}) ⇒ Object



24
25
26
27
28
# 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 = {}) ⇒ Object



36
37
38
39
# 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 = {}) ⇒ Object



30
31
32
33
34
# 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