Ignore setsid failures.

This commit is contained in:
Joey Hess 2014-06-09 14:44:18 -04:00
parent b6274745b4
commit 787d9e27ba
3 changed files with 10 additions and 2 deletions

View file

@ -39,7 +39,7 @@ daemonize logfd pidfile changedirectory a = do
checkalreadyrunning f = maybe noop (const alreadyRunning)
=<< checkDaemon f
child1 = do
_ <- createSession
_ <- tryIO createSession
_ <- forkProcess child2
out
child2 = do
@ -59,7 +59,7 @@ daemonize logfd pidfile changedirectory a = do
foreground :: Fd -> Maybe FilePath -> IO () -> IO ()
foreground logfd pidfile a = do
maybe noop lockPidFile pidfile
_ <- createSession
_ <- tryIO createSession
redirLog logfd
a
exitImmediately ExitSuccess