# File lib/chef/provider/service/init.rb, line 35 def define_resource_requirements # do not call super here, inherit only shared_requirements shared_resource_requirements requirements.assert(:start, :stop, :restart, :reload) do |a| a.assertion do custom_command_for_action?(action) || ::File.exist?(default_init_command) end a.failure_message(Chef::Exceptions::Service, "#{default_init_command} does not exist!") a.whyrun("Init script '#{default_init_command}' doesn't exist, assuming a prior action would have created it.") do # blindly assume that the service exists but is stopped in why run mode: @status_load_success = false end end end
# File lib/chef/provider/service/init.rb, line 78 def reload_service if @new_resource.reload_command super elsif @new_resource.supports[:reload] shell_out!("#{default_init_command} reload") end end
# File lib/chef/provider/service/init.rb, line 66 def restart_service if @new_resource.restart_command super elsif @new_resource.supports[:restart] shell_out!("#{default_init_command} restart") else stop_service sleep 1 start_service end end
Generated with the Darkfish Rdoc Generator 2.