> My understanding is that System.Process avoids these problems by doing > all the setup around forking a command in C code. I've banished > forkProcess from my code base entirely, except for a double fork I need > to daemonize, and I don't even trust that call. :/
I think you are right. forkProcess is necessary to deamonize a process but I don't know other usage. daemonize :: IO () -> IO () daemonize program = ensureDetachTerminalCanWork $ do detachTerminal ensureNeverAttachTerminal $ do changeWorkingDirectory "/" void $ setFileCreationMask 0 mapM_ closeFd [stdInput, stdOutput, stdError] program where ensureDetachTerminalCanWork p = do void $ forkProcess p exitSuccess ensureNeverAttachTerminal p = do void $ forkProcess p exitSuccess detachTerminal = void createSession --Kazu _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe