I have a script that is coded in the manner below. I want to run this as a background/daemon process however once I start the script, if then I close the terminal window that it was run from the program terminates. What do I need to do to keep the program running
loop do
pid = fork do
..........
..........
..........
end
Process.detach(pid)
end