How can I find a pid by name or full command line in Ruby, without calling an externally executable?
In my example below, I am sending a SIGUSR2 to a process who's command line contained "ruby job.rb". I would like to do the following without the call to pgrep:
uid = Process.uid
pid = `pgrep -f "ruby job.rb" -u #{uid}`.split("\n").first.to_i
Process.kill "USR2", pid