Class: Specinfra::Command::Debian::Base::Service
Class Method Summary
collapse
#check_is_monitored_by_god
#check_is_monitored_by_monit
#check_is_enabled_under_runit, #check_is_running_under_runit
#check_is_running_under_upstart
#check_is_running_under_supervisor
#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
#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
#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
#def_delegator_service_under
Methods inherited from Base
escape
Class Method Details
.check_is_enabled(service, level = 3) ⇒ Object
12
13
14
15
|
# File 'lib/specinfra/command/debian/base/service.rb', line 12
def check_is_enabled(service, level=3)
"ls /etc/rc#{level}.d/ | grep -- '^S..#{escape(service)}$' || grep '^\s*start on' /etc/init/#{escape(service)}.conf"
end
|
.create(os_info = nil) ⇒ Object
3
4
5
6
7
8
9
10
|
# File 'lib/specinfra/command/debian/base/service.rb', line 3
def create(os_info=nil)
release = (os_info || os)[:release]
if ["testing", "unstable"].include?(release) || release.to_i >= 8
Specinfra::Command::Debian::V8::Service
else
self
end
end
|
.disable(service) ⇒ Object
21
22
23
|
# File 'lib/specinfra/command/debian/base/service.rb', line 21
def disable(service)
"update-rc.d -f #{escape(service)} remove"
end
|
.enable(service) ⇒ Object
17
18
19
|
# File 'lib/specinfra/command/debian/base/service.rb', line 17
def enable(service)
"update-rc.d #{escape(service)} defaults"
end
|
.reload(service) ⇒ Object
37
38
39
|
# File 'lib/specinfra/command/debian/base/service.rb', line 37
def reload(service)
"service #{escape(service)} reload"
end
|
.restart(service) ⇒ Object
33
34
35
|
# File 'lib/specinfra/command/debian/base/service.rb', line 33
def restart(service)
"service #{escape(service)} restart"
end
|
.start(service) ⇒ Object
25
26
27
|
# File 'lib/specinfra/command/debian/base/service.rb', line 25
def start(service)
"service #{escape(service)} start"
end
|
.stop(service) ⇒ Object
29
30
31
|
# File 'lib/specinfra/command/debian/base/service.rb', line 29
def stop(service)
"service #{escape(service)} stop"
end
|