For your timing, you can use a thread:
Thread.new do
sleep 10 * 60
begin
Process.kill('QUIT', pid)
rescue Errno::ESRCH
# process exited normally
end
end
_, status = Process.wait2 pid
puts status.exited?
I am unsure of why QUIT is not working for you. I could not replicate your error.