def get_priority
assert_update_rcd_available
priority = {}
status = popen4("/usr/sbin/update-rc.d -n -f #{@current_resource.service_name} remove") do |pid, stdin, stdout, stderr|
[stdout, stderr].each do |iop|
iop.each_line do |line|
if UPDATE_RC_D_PRIORITIES =~ line
priority[$1] = [($2 == "S" ? :start : :stop), $3]
end
if line =~ UPDATE_RC_D_ENABLED_MATCHES
enabled = true
end
end
end
end
unless status.exitstatus == 0
raise Chef::Exceptions::Service, "/usr/sbin/update-rc.d -n -f #{@current_resource.service_name} failed - #{status.inspect}"
end
priority
end