Sha256: b1029c90be20fb3a038178646eaad1795ad9f94cebe12ea1784635fe9a34a212
Contents?: true
Size: 1.07 KB
Versions: 14
Compression:
Stored size: 1.07 KB
Contents
module Specinfra module Command module Module module Systemd def check_is_enabled(service, level="multi-user.target") if level.to_s =~ /^\d+$/ level = "runlevel#{level}.target" end unless service.include?('.') service += '.service' end "systemctl --plain list-dependencies #{level} | grep '\\(^\\| \\)#{escape(service)}$'" end def check_is_running(service) "systemctl is-active #{escape(service)}" end def enable(service) "systemctl enable #{escape(service)}" end def disable(service) "systemctl disable #{escape(service)}" end def start(service) "systemctl start #{escape(service)}" end def stop(service) "systemctl stop #{escape(service)}" end def restart(service) "systemctl restart #{escape(service)}" end def reload(service) "systemctl reload #{escape(service)}" end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems