Ruby on Rails
Monday, May 30, 2011
Kill process by his name ruby
require 'rubygems'
require 'sys/proctable'
include Sys
Sys::ProcTable.ps.each { |ps|
if ps.name.downcase == "process name"
Process.kill('KILL', ps.pid)
end
}
#Run script as root user
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment