public
Created

zombie process created by ruby

  • Download Gist
gistfile1.sh
Shell
1 2 3 4 5 6 7
$ (ruby zombie.rb & ) ; sleep 2 ; ps
PID TTY TIME CMD
8609 pts/2 00:00:00 zsh
8651 pts/2 00:00:00 sh
8653 pts/2 00:00:00 ruby
8655 pts/2 00:00:00 sleep <defunct>
8656 pts/2 00:00:00 ps
zombie.rb
Ruby
1 2 3 4 5 6 7 8 9 10
require 'timeout'
 
begin
Timeout.timeout(1) do
system('sleep 2')
end
rescue Timeout::Error
end
 
sleep 30

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.