utils
utils copied to clipboard
Detach Helper
Description
Implement a new package with the capability to run code portions in detached mode from the original process:
detach.Run(func f() {
...
})
Possible approaches:
- Double
fork(..)(original process => fork => fork) - Use
os.StartProcessand thenprocess.Release()withsyscall.SysProcAttr{Noctty:true}attribute (ref. https://stackoverflow.com/questions/23031752/start-a-process-in-go-and-detach-from-it)