-
-
Save brainopia/34ae5c007ab43de960e2 to your computer and use it in GitHub Desktop.
fork returns pid of intermediate process of actual ruby process on linux
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
$ uname -a | |
Linux 2.6.39.1-linode34 #1 SMP Tue Jun 21 10:29:24 EDT 2011 i686 GNU/Linux | |
$ ruby -v | |
ruby 1.9.3dev (2011-07-31 revision 32789) [i686-linux] | |
$ ruby -e "pid = fork { exec 'ruby -e \"sleep 30\"' }; p pid" | |
30279 | |
$ ps -f | grep ruby | |
root 30279 1 0 08:47 pts/1 00:00:00 sh -c ruby -e "sleep 30" | |
root 30282 30279 0 08:47 pts/1 00:00:00 ruby -e sleep 30 | |
wtf?! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment