class AutomateIt::ServiceManager::UpdateRCD
ServiceManager::UpdateRCD¶ ↑
The UpdateRCD
driver implements the ServiceManager methods for enabled?
, enable
and disable
on Debian-like platforms. It uses the SYSV driver for handling the methods running?
, start
and stop
.
Constants
- TOOL
Public Instance Methods
disable(service, opts={})
click to toggle source
See ServiceManager#disable
# File lib/automateit/service_manager/update_rcd.rb, line 23 def disable(service, opts={}) _raise_unless_available return false unless enabled?(service) interpreter.sh("#{TOOL} -f #{service} remove < /dev/null > /dev/null") end
enable(service, opts={})
click to toggle source
See ServiceManager#enable
# File lib/automateit/service_manager/update_rcd.rb, line 16 def enable(service, opts={}) _raise_unless_available return false if enabled?(service) interpreter.sh("#{TOOL} #{service} defaults < /dev/null > /dev/null") end
enabled?(service, opts={})
click to toggle source
# File lib/automateit/service_manager/update_rcd.rb, line 29 def enabled?(service, opts={}) _raise_unless_available cmd = "#{TOOL} -n -f #{service} remove < /dev/null" output = `#{cmd}` return ! output.match(/etc\/rc[\dS].d|Nothing to do\./).nil? end