Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- begin
- require 'sys/proctable'
- rescue LoadError
- Chef::Log.warn("Missing gem 'sys-proctable'")
- end
- begin
- include Sys
- rescue NameError
- Chef::Log.warn("Missing name 'Sys'")
- end
- module Rackspace
- def self.getProcPid(name)
- Gem.clear_paths
- ::Sys::ProcTable.ps do |p|
- if /#{name}/ =~ p.cmdline
- return p.pid
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment