# File lib/chef/provider/service/init.rb, line 36 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 { ::File.exist?(@init_command) } a.failure_message(Chef::Exceptions::Service, "#{@init_command} does not exist!") a.whyrun("Init script '#{@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 77 def reload_service if @new_resource.reload_command super elsif @new_resource.supports[:reload] shell_out!("#{@init_command} reload") end end
# File lib/chef/provider/service/init.rb, line 65 def restart_service if @new_resource.restart_command super elsif @new_resource.supports[:restart] shell_out!("#{@init_command} restart") else stop_service sleep 1 start_service end end
Generated with the Darkfish Rdoc Generator 2.