Use Process.daemon and test for it