sys icon indicating copy to clipboard operation
sys copied to clipboard

Prevent orphans

Open jeroen opened this issue 8 years ago • 0 comments

library(sys)
# system2 dies along with the parent proc
eval_fork({system2("ping", "localhost", wait = FALSE); Sys.sleep(3)})

# pipe breaks when interrupted, but process lives on! (on OSX at least)
eval_fork(exec_wait("ping", "localhost"), timeout = 3)
  
# but eval_background escapes (because of setpgid())
eval_fork(exec_background("ping", "localhost"))

jeroen avatar May 20 '17 19:05 jeroen