# File lib/puppet/provider/service/launchd.rb, line 136 136: def status 137: # launchctl list <jobname> exits zero if the job is loaded 138: # and non-zero if it isn't. Simple way to check... but is only 139: # available on OS X 10.5 unfortunately, so we grab the whole list 140: # and check if our resource is included. The output formats differ 141: # between 10.4 and 10.5, thus the necessity for splitting 142: begin 143: output = launchctl :list 144: raise Puppet::Error.new("launchctl list failed to return any data.") if output.nil? 145: output.split("\n").each do |j| 146: return :running if j.split(/\s/).last == resource[:name] 147: end 148: return :stopped 149: rescue Puppet::ExecutionFailure 150: raise Puppet::Error.new("Unable to determine status of #{resource[:name]}") 151: end 152: end