Module: LoomExt::CoreMods::Systemd::Actions

Defined in:
lib/loomext/coremods/system.rb

Instance Method Summary collapse

Instance Method Details

#disable(unit) ⇒ Object



33
34
35
# File 'lib/loomext/coremods/system.rb', line 33

def disable(unit)
  do_systemctl "disable", unit
end

#enable(unit) ⇒ Object



25
26
27
# File 'lib/loomext/coremods/system.rb', line 25

def enable(unit)
  do_systemctl "enable", unit
end

#is_active?(unit) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/loomext/coremods/system.rb', line 17

def is_active?(unit)
  status(unit).match? /^\s+Active:\sactive\s/
end

#is_loaded?(unit) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/loomext/coremods/system.rb', line 13

def is_loaded?(unit)
  status(unit).match? /^\s+Loaded:\sloaded\s/
end


45
46
47
# File 'lib/loomext/coremods/system.rb', line 45

def link(path)
  do_systemctl "link", path
end

#restart(unit) ⇒ Object



37
38
39
# File 'lib/loomext/coremods/system.rb', line 37

def restart(unit)
  do_systemctl "restart", unit
end

#start(unit) ⇒ Object



29
30
31
# File 'lib/loomext/coremods/system.rb', line 29

def start(unit)
  do_systemctl "start", unit
end

#status(unit) ⇒ Object



21
22
23
# File 'lib/loomext/coremods/system.rb', line 21

def status(unit)
  do_systemctl "status", unit
end

#stop(unit) ⇒ Object



41
42
43
# File 'lib/loomext/coremods/system.rb', line 41

def stop(unit)
  do_systemctl "stop", unit
end