lib/chef/provider/service/freebsd.rb in chef-0.7.10 vs lib/chef/provider/service/freebsd.rb in chef-0.7.12
- old
+ new
@@ -68,10 +68,10 @@
if @node[:command][:ps].nil? or @node[:command][:ps].empty?
raise Chef::Exceptions::Service, "#{@new_resource}: could not determine how to inspect the process table, please set this nodes 'ps' attribute"
end
status = popen4(@node[:command][:ps]) do |pid, stdin, stdout, stderr|
- stdin.close
+ stdin.close rescue nil
r = Regexp.new(@new_resource.pattern)
Chef::Log.debug("#{@new_resource}: attempting to match #{@new_resource.pattern} (#{r}) against process table")
stdout.each_line do |line|
if r.match(line)
@current_resource.running true