Module: Specinfra::Command::Module::Service::OpenRC
- Included in:
- OpenRC
- Defined in:
- lib/specinfra/command/module/service/openrc.rb
Instance Method Summary collapse
- #check_is_enabled_under_openrc(service, level = 3) ⇒ Object
- #check_is_running_under_openrc(service) ⇒ Object
- #disable_under_openrc(service) ⇒ Object
- #enable_under_openrc(service) ⇒ Object
- #reload_under_openrc(service) ⇒ Object
- #restart_under_openrc(service) ⇒ Object
- #start_under_openrc(service) ⇒ Object
- #stop_under_openrc(service) ⇒ Object
Instance Method Details
#check_is_enabled_under_openrc(service, level = 3) ⇒ Object
6 7 8 |
# File 'lib/specinfra/command/module/service/openrc.rb', line 6 def check_is_enabled_under_openrc(service, level=3) "rc-update show boot default | grep -w #{escape(service)}" end |
#check_is_running_under_openrc(service) ⇒ Object
10 11 12 |
# File 'lib/specinfra/command/module/service/openrc.rb', line 10 def check_is_running_under_openrc(service) "/etc/init.d/#{escape(service)} status" end |
#disable_under_openrc(service) ⇒ Object
18 19 20 |
# File 'lib/specinfra/command/module/service/openrc.rb', line 18 def disable_under_openrc(service) "rc-update del #{escape(service)}" end |
#enable_under_openrc(service) ⇒ Object
14 15 16 |
# File 'lib/specinfra/command/module/service/openrc.rb', line 14 def enable_under_openrc(service) "rc-update add #{escape(service)}" end |
#reload_under_openrc(service) ⇒ Object
34 35 36 |
# File 'lib/specinfra/command/module/service/openrc.rb', line 34 def reload_under_openrc(service) "/etc/init.d/#{escape(service)} reload" end |
#restart_under_openrc(service) ⇒ Object
30 31 32 |
# File 'lib/specinfra/command/module/service/openrc.rb', line 30 def restart_under_openrc(service) "rc-service #{escape(service)} restart" end |
#start_under_openrc(service) ⇒ Object
22 23 24 |
# File 'lib/specinfra/command/module/service/openrc.rb', line 22 def start_under_openrc(service) "rc-service #{escape(service)} start" end |
#stop_under_openrc(service) ⇒ Object
26 27 28 |
# File 'lib/specinfra/command/module/service/openrc.rb', line 26 def stop_under_openrc(service) "rc-service #{escape(service)} stop" end |