Class: Specinfra::Command::Debian::Base::Service
- Inherits:
-
Linux::Base::Service
- Object
- Base
- Base::Service
- Linux::Base::Service
- Specinfra::Command::Debian::Base::Service
- Defined in:
- lib/specinfra/command/debian/base/service.rb
Direct Known Subclasses
Cumuluslinux::Base::Service, V8::Service, Ubuntu::Base::Service
Class Method Summary collapse
- .check_is_enabled(service, level = 3) ⇒ Object
- .disable(service) ⇒ Object
- .enable(service) ⇒ Object
- .reload(service) ⇒ Object
- .restart(service) ⇒ Object
- .start(service) ⇒ Object
- .stop(service) ⇒ Object
Methods included from Module::Service::God
Methods included from Module::Service::Monit
Methods included from Module::Service::Runit
#check_is_enabled_under_runit, #check_is_running_under_runit
Methods included from Module::Service::Upstart
#check_is_running_under_upstart
Methods included from Module::Service::Supervisor
#check_is_running_under_supervisor
Methods included from Module::Service::Daemontools
#check_is_enabled_under_daemontools, #check_is_running_under_daemontools, #disable_under_daemontools, #enable_under_daemontools, #reload_under_daemontools, #restart_under_daemontools, #start_under_daemontools, #stop_under_daemontools
Methods included from Module::Service::Systemd
#check_is_enabled_under_systemd, #check_is_running_under_systemd, #disable_under_systemd, #enable_under_systemd, #reload_under_systemd, #restart_under_systemd, #start_under_systemd, #stop_under_systemd
Methods included from Module::Service::Init
#check_is_enabled_under_init, #check_is_running_under_init, #disable_under_init, #enable_under_init, #reload_under_init, #restart_under_init, #start_under_init, #stop_under_init
Methods included from Module::Service::Delegator
Methods inherited from Base
Class Method Details
.check_is_enabled(service, level = 3) ⇒ Object
3 4 5 6 |
# File 'lib/specinfra/command/debian/base/service.rb', line 3 def check_is_enabled(service, level=3) # Until everything uses Upstart, this needs an OR. "ls /etc/rc#{level}.d/ | grep -- '^S..#{escape(service)}$' || grep '^\s*start on' /etc/init/#{escape(service)}.conf" end |
.disable(service) ⇒ Object
12 13 14 |
# File 'lib/specinfra/command/debian/base/service.rb', line 12 def disable(service) "update-rc.d -f #{escape(service)} remove" end |
.enable(service) ⇒ Object
8 9 10 |
# File 'lib/specinfra/command/debian/base/service.rb', line 8 def enable(service) "update-rc.d #{escape(service)} defaults" end |
.reload(service) ⇒ Object
28 29 30 |
# File 'lib/specinfra/command/debian/base/service.rb', line 28 def reload(service) "service #{escape(service)} reload" end |
.restart(service) ⇒ Object
24 25 26 |
# File 'lib/specinfra/command/debian/base/service.rb', line 24 def restart(service) "service #{escape(service)} restart" end |
.start(service) ⇒ Object
16 17 18 |
# File 'lib/specinfra/command/debian/base/service.rb', line 16 def start(service) "service #{escape(service)} start" end |
.stop(service) ⇒ Object
20 21 22 |
# File 'lib/specinfra/command/debian/base/service.rb', line 20 def stop(service) "service #{escape(service)} stop" end |