In a ruby process I fork off a child with a system call in it.
I want to be able to kill the child and have that propagate to the system call, but the system call keeps running:
unless pid=fork
system("echo start ; sleep 1 ; echo 1 ; sleep 1 ; echo 2 ; sleep 1 ; echo 3")
exit
end
puts "Child: #{pid}"
sleep 2
Process.kill('-KILL',-pid)
How can I propagate the kill from ruby to it's forked system call?