Skip to content

Instantly share code, notes, and snippets.

@khash
Created March 14, 2016 11:39
Show Gist options
  • Save khash/cb2d6d6c6cd8736b9a1a to your computer and use it in GitHub Desktop.
Save khash/cb2d6d6c6cd8736b9a1a to your computer and use it in GitHub Desktop.
Simple Ruby Signal Trap
Signal.trap("USR1") do
puts "Got a USR1"
end
Signal.trap("USR2") do
puts "Got a USR2"
end
puts "Waiting for signals..."
while true do
sleep(1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment