Created
February 16, 2012 13:19
-
-
Save timurb/1844777 to your computer and use it in GitHub Desktop.
zombie process created by ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ (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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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