Sha256: 873e4c25dc2102a327068bba18137f23f666aaf3cc1d655b2edd93a18ba54a29
Contents?: true
Size: 1.3 KB
Versions: 21
Compression:
Stored size: 1.3 KB
Contents
module Specinfra module Command module Module module Service module Systemd def check_is_enabled_under_systemd(service, level="multi-user.target") if level.to_s =~ /^\d+$/ level = "runlevel#{level}.target" end unless service.match(/\.(service|mount|device|socket)$/) service += '.service' end "systemctl --plain list-dependencies #{level} | grep '\\(^\\| \\)#{escape(service)}$'" end def check_is_running_under_systemd(service) "systemctl is-active #{escape(service)}" end def enable_under_systemd(service) "systemctl enable #{escape(service)}" end def disable_under_systemd(service) "systemctl disable #{escape(service)}" end def start_under_systemd(service) "systemctl start #{escape(service)}" end def stop_under_systemd(service) "systemctl stop #{escape(service)}" end def restart_under_systemd(service) "systemctl restart #{escape(service)}" end def reload_under_systemd(service) "systemctl reload #{escape(service)}" end end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems