Use Process.kill
Process.kill(1,pid1) # Send signal 1 to process pid1
Process.kill("HUP",pid2) # Send SIGHUP to pid2
Process.kill("SIGHUP",pid2) # Send SIGHUP to pid3
Process.kill("SIGHUP",0) # Send SIGHUP to self
trap(1) { puts "Caught signal 1" }
sleep 2
Process.kill(1,0) # Send to self
Related examples in the same category