Skip to content

Instantly share code, notes, and snippets.

@timurb
Created February 16, 2012 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timurb/1844777 to your computer and use it in GitHub Desktop.
Save timurb/1844777 to your computer and use it in GitHub Desktop.
zombie process created by ruby
$ (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
require 'timeout'
begin
Timeout.timeout(1) do
system('sleep 2')
end
rescue Timeout::Error
end
sleep 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment