Actions
Bug #4939
closedSignal handling does not working if single grave accent ( ` ) initiated command was issued before Signal.trap
Bug #4939:
Signal handling does not working if single grave accent ( ` ) initiated command was issued before Signal.trap
Description
If grave accent ( ) shell command (
whoami` in the following case) is called BEFORE Signal.trap,
the signals will not be handled, and ruby default handling behavior also did not work.
Basically, when I press Ctrl+C or send kill -TERM nothing happens - the process continues to run (or sleep(60) in that case).
This whoami
call prevents the following signal handlers from working¶
Just comment this line and signal handling will be ok¶
STDOUT.write whoami
STDOUT.puts "Press Ctrl+C"
Signal.trap(:INT) { STDOUT.write "GOT INT\n"; exit! }
Signal.trap(:TERM) { STDOUT.write "GOT TERM\n"; exit! }
sleep 60
Actions