1 Add check for existence of smf service
3 --- puppet-3.8.6/lib/puppet/provider/service/smf.rb.orig 2016-04-19 14:26:51.367951573 -0700
4 +++ puppet-3.8.6/lib/puppet/provider/service/smf.rb 2016-04-19 14:27:31.661139999 -0700
6 +#######################################################################
7 +# Oracle has modified the originally distributed contents of this file.
8 +#######################################################################
10 # Solaris 10 SMF-style services.
11 Puppet::Type.type(:service).provide :smf, :parent => :base do
17 + # get the current state and the next state, and if the next
18 + # state is set (i.e. not "-") use it for state comparison
20 + # Check to see if the service exists
21 + cmd = Array[command(:svccfg), "select", @resource[:name]]
22 + output = Puppet::Util::Execution.execute(
23 + cmd, :combine => true, :failonfail => false)
24 + if $CHILD_STATUS.exitstatus != 0
29 - # get the current state and the next state, and if the next
30 - # state is set (i.e. not "-") use it for state comparison
31 states = svcs("-H", "-o", "state,nstate", @resource[:name]).chomp.split
32 state = states[1] == "-" ? states[0] : states[1]
33 rescue Puppet::ExecutionFailure