Phil asked: > I need to be able to kill system commands which have run too long. I > tried the following code to no avail: I might not be helping you here at all, but I'll note this anyway. I had to ping couple of machines with the ping coming with the system, so I did like this: for ip in ips # let's ping on child, so it can die after unsuccesful pinging child_pid = fork { # interrupts pinging, if no response begin timeout(10) { # ping the machine rep=`ping -c 1 #{ip}` # print present, if the machine responded with at # least 1 packet puts ip+" present" if rep=~/(\d+) packets received/ && $1.to_i > 0 } rescue #puts "interrupted" end exit } # the parent has to wait that child do it's work 13.times do sleep 1 # check if child died, so we can continue immediately break if Process.waitpid(child_pid, Process::WNOHANG) end end - Aleksi