# File lib/puppet/provider/service/smf.rb, line 64
64:   def status
65:     if @resource[:status]
66:       super
67:       return
68:     end
69: 
70:     begin
71:       # get the current state and the next state, and if the next
72:       # state is set (i.e. not "-") use it for state comparison
73:       states = svcs("-H", "-o", "state,nstate", @resource[:name]).chomp.split
74:       state = states[1] == "-" ? states[0] : states[1]
75:     rescue Puppet::ExecutionFailure
76:       info "Could not get status on service #{self.name}"
77:       return :stopped
78:     end
79: 
80:     case state
81:     when "online"
82:       #self.warning "matched running #{line.inspect}"
83:       return :running
84:     when "offline", "disabled", "uninitialized"
85:       #self.warning "matched stopped #{line.inspect}"
86:       return :stopped
87:     when "maintenance"
88:       return :maintenance
89:     when "legacy_run"
90:       raise Puppet::Error,
91:         "Cannot manage legacy services through SMF"
92:     else
93:       raise Puppet::Error,
94:         "Unmanageable state '#{state}' on service #{self.name}"
95:     end
96: 
97:   end