[Haskell-cafe] how to implement daemon start and stop directives?

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Fri Jan 23 23:29:43 EST 2009


On 2009 Jan 22, at 3:11, Belka wrote:
> Actually, I'm more interested in technical details how to  
> communicate from
> shell with background process - how to send commands to it. Currently
> looking into POSIX libraries hope to find answers there...
> Also, maybe a FIFO-pipe-file would solve my problem. Imagine writing a
> command in it, while one of daemon's thread is locked-while-awaits for
> anything to come out from the other side of the pipe...

You can try it; make sure to open the FIFO for read+write to avoid  
deadlocks, and I think there are some weird behaviors caused by the  
GHC runtime's non-blocking IO.  It will be a lot easier to use a  
socket (AF_INET or AF_UNIX depending on whether you want to support  
remote access or not).

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Haskell-Cafe mailing list