maintenance[R]
# File lib/chef/provider/service/solaris.rb, line 54 def disable_service shell_out!("#{default_init_command} disable -s #{@new_resource.service_name}") end
# File lib/chef/provider/service/solaris.rb, line 49 def enable_service shell_out!("#{default_init_command} clear #{@new_resource.service_name}") if @maintenance shell_out!("#{default_init_command} enable -s #{@new_resource.service_name}") end
# File lib/chef/provider/service/solaris.rb, line 39 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 61 def reload_service shell_out!("#{default_init_command} refresh #{@new_resource.service_name}") end
# File lib/chef/provider/service/solaris.rb, line 65 def restart_service ## svcadm restart doesn't supports sync(-s) option disable_service return enable_service end
# File lib/chef/provider/service/solaris.rb, line 71 def service_status status = shell_out!("#{@status_command} #{@current_resource.service_name}", :returns => [0, 1]) status.stdout.each_line do |line| case line when /state\s+online/ @current_resource.enabled(true) @current_resource.running(true) when /state\s+maintenance/ @maintenance = true 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.