å¤å ããã»ã¹ã¨ã¾ã³ãããã»ã¹ã®éãããã¾ãç解ã§ãã¦ãªãã£ããã©ãããããéãã確èªãããã¨ãã§ããã å¤å ããã»ã¹ å¤å ããã»ã¹ã¯ã親ããã»ã¹ãwaitããã«å ã«éã£ã¦ãã¾ã£ãå¾ãèµ°ãç¶ãã¦ããåããã»ã¹ã Orphan Process ã¨ãå¼ã°ããã 親ã®ããªããªã£ãåããã»ã¹ã¯initããã»ã¹ã®åï¼å¤å ï¼ã«ãªãã 親ããã»ã¹ãæ»ãã§ãåããã»ã¹ã®è¦ªãå¤åããæ§åãè¦ãã«ã¯ä»¥ä¸ã®ãããªã¹ã¯ãªãããå®è¡ãããã¨ã§ãã¡ã¤ã«ãtailããã¨åããããããã Process.fork do File.open('orphan', 'a') do |f| loop do sleep 1 # 親ããã»ã¹ã®pidããã¡ã¤ã«ã«æ¸ãåºã f.puts Process.ppid f.flush end end end sleep 5 ãã®ããã°ã©ã ãå®è¡ãã¦ãorphanãtail -fã§è¦³å¯ãã¦ããã¨ã
{{#tags}}- {{label}}
{{/tags}}