scvalex / daemons Goto Github PK
View Code? Open in Web Editor NEWDaemons in Haskell made fun and easy
License: GNU General Public License v3.0
Daemons in Haskell made fun and easy
License: GNU General Public License v3.0
The MissingH package also exports a module named System.Daemon. There is no problem installing both packages, however, when loading System.Daemon in ghci, it complains
Ξ»> import System.Daemon
<no location info>:
Ambiguous module name `System.Daemon':
it was found in multiple packages: MissingH-1.2.0.0 daemons-0.1.2
Is there a way to work around this?
I'd like the daemon to be able to use the native credentials passing mechanism on Linux, namely SO_PEERCRED or SO_PASSCRED
http://linux.die.net/man/7/socket
http://hackage.haskell.org/package/network-2.0/docs/Network-Socket.html#v%3AgetPeerCred
Thank you for your work on this package!
Is there a reason you use SIGQUIT
for kill
and killAndWait
? The default behavior on Linux is to terminate the process and dump core on SIGQUIT
. I think it might make more sense to use SIGTERM
, which is the default for kill(1)
. Would you be inclined to accept a PR to switch to SIGTERM
?
50% of the time or more, the extra process created in the double-fork sticks around, as a parent of the daemon. The daemon works, except when it exits, it remains a zombie because the parent doesn't wait on its result. When the parent is killed with SIGKILL (-9), then both processes die.
... needed to daemonize our Haskell web-server and this package did the job in 5 mins. Great documentation! π
Discussed with my friend @guibou who is a bit more handy than me with haskell. He said he'll do a PR
117 β Building library for daemons-0.2.1..
118 β [1 of 5] Compiling Control.Pipe.Serialize ( src/Control/Pipe/Serialize.hs, dist/dist-sandbox-3b586ae8/build/Control/Pipe/Serialize.o )
119 β
120 β src/Control/Pipe/Serialize.hs:33:16: error:
121 β β’ Could not deduce (MonadFail m) arising from a use of βloopβ
122 β from the context: (Serialize a, Monad m)
123 β bound by the type signature for:
124 β deserializer :: forall a (m :: * -> *).
125 β (Serialize a, Monad m) =>
126 β Pipe ByteString a m ()
127 β at src/Control/Pipe/Serialize.hs:32:1-64
128 β Possible fix:
129 β add (MonadFail m) to the context of
130 β the type signature for:
131 β deserializer :: forall a (m :: * -> *).
132 β (Serialize a, Monad m) =>
133 β Pipe ByteString a m ()
134 β β’ In the expression: loop Nothing Nothing
135 β In an equation for βdeserializerβ:
136 β deserializer
137 β = loop Nothing Nothing
138 β where
139 β loop mk mbin
140 β = do bin <- maybe await return mbin
141 β ....
142 β |
143 β 33 | deserializer = loop Nothing Nothing
144 β | ^^^^^^^^^^^^^^^^^^^^
Would it be possible to run daemons
on Windows?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.