# File lib/chef/provider/service/solaris.rb, line 49 def disable_service run_command(:command => "#{@init_command} disable #{@new_resource.service_name}") return service_status.enabled end
# File lib/chef/provider/service/solaris.rb, line 44 def enable_service run_command(:command => "#{@init_command} enable #{@new_resource.service_name}") return service_status.enabled end
# File lib/chef/provider/service/solaris.rb, line 34 def load_current_resource @current_resource = Chef::Resource::Service.new(@new_resource.name) @current_resource.service_name(@new_resource.service_name) unless ::File.exists? "/bin/svcs" raise Chef::Exceptions::Service, "/bin/svcs does not exist!" end @status = service_status.enabled @current_resource end
# File lib/chef/provider/service/solaris.rb, line 57 def reload_service run_command(:command => "#{@init_command} refresh #{@new_resource.service_name}") end
# File lib/chef/provider/service/solaris.rb, line 61 def restart_service disable_service return enable_service end
# File lib/chef/provider/service/solaris.rb, line 66 def service_status status = popen4("#{@status_command} #{@current_resource.service_name}") do |pid, stdin, stdout, stderr| stdout.each do |line| case line when /state\s+online/ @current_resource.enabled(true) @current_resource.running(true) end end end unless @current_resource.enabled @current_resource.enabled(false) @current_resource.running(false) end @current_resource end
Generated with the Darkfish Rdoc Generator 2.