I need to spawn an independent background Julia process from a shiny app that survives once the app is closed.
If the Julia process is called inline:
sys::exec_background('nohup', c("julia", "-e sleep(3000)", "&")
the child process survives the Shiny app once it get closed.
But if the Julia process is called on a script with just the same sleep(3000)
call inside:
sys::exec_background('nohup', c("julia", "test.jl", "&")
once the Shiny app closes also the Julia process gets killed with error:
signal (2): Interrupt: 2
in expression starting at .../test.jl:1
kevent at /usr/lib/system/libsystem_kernel.dylib (unknown line)
unknown function (ip: 0x0)
Allocations: 2650 (Pool: 2641; Big: 9); GC: 0
Any idea why and any solution on how to have the Julia script process survive the parent app?
Here's the code to reproduce the behaviour. https://gist.github.com/bakaburg1/5d1b5135fb3b4db1a3ca2eb7e8639aa5 Just run the Shiny app and then close it. Only the inline code Julia process survives.