#4449: GHC 7 can't do IO when demonized
----------------------------+-----------------------------------------------
Reporter: kazu-yamamoto | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 7.1
Resolution: invalid | Keywords: forkProcess
Testcase: | Blockedby:
Difficulty: | Os: MacOS X
Blocking: | Architecture: x86
Failure: None/Unknown |
----------------------------+-----------------------------------------------
Changes (by simonmar):
* status: new => closed
* resolution: => invalid
Comment:
Replying to [comment:16 kazu-yamamoto]:
> What is a right way to implement daemons in GHC7? Use hdaemonize instead
of direct-daemonize?
Yes, the problem is that you can't call `fork()` directly when using
`-threaded`, you have to use `System.Posix.forkProcess` instead. `direct-
daemonize` will not work with `-threaded`, because it calls `daemon()`
which internally calls `forkIO`.
I haven't looked at `hdaemonize`, but I imagine it calls
`System.Posix.forkProcess`, so it should be safe.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4449#comment:18>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs