I want to use system method to run a background process, like system("ruby deamon.rb") # the deamon.rb runs a dead loop When my main process ends, I want to end the background process
How can I do it? If I can get the pid of background process, I can use
Process.kill. But the system method dosen’t return the pid.
Does anyone here know the solution? Thank you