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

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

Instance Method Summary collapse

Instance Method Details

#disable(unit) ⇒ Object



47
48
49
# File 'lib/loomext/coremods/systemd/systemd.rb', line 47

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

#enable(unit) ⇒ Object



39
40
41
# File 'lib/loomext/coremods/systemd/systemd.rb', line 39

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

#is_active?(unit) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/loomext/coremods/systemd/systemd.rb', line 31

def is_active?(unit)
  do_systemctl "is-active", unit
end

#is_loaded?(unit) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/loomext/coremods/systemd/systemd.rb', line 27

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


59
60
61
# File 'lib/loomext/coremods/systemd/systemd.rb', line 59

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

#restart(unit) ⇒ Object



51
52
53
# File 'lib/loomext/coremods/systemd/systemd.rb', line 51

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

#start(unit) ⇒ Object



43
44
45
# File 'lib/loomext/coremods/systemd/systemd.rb', line 43

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

#status(unit) ⇒ Object



35
36
37
# File 'lib/loomext/coremods/systemd/systemd.rb', line 35

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

#stop(unit) ⇒ Object



55
56
57
# File 'lib/loomext/coremods/systemd/systemd.rb', line 55

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