[Haskell-cafe] daemon process

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Tue Oct 21 01:24:20 EDT 2008

On 2008 Oct 20, at 15:42, Rouan van Dalen wrote:
> I would like to write a very very simple haskell daemon that  
> disconnects itself from the terminal
> and sists in the background doing something.
> What is the easiest way to go about this.  I have tried several  
> things but can't seem to
> get the process disconnected from the terminal.

System.Posix.Process.createSession makes the current process a  
separate session with no controlling terminal assigned to it.   
(Acquiring a controlling terminal afterward is, sadly, nonportable:   
some systems do it automatically unless you open() with O_NOCTTY, some  
require you to open and ioctl(TIOCSCTTY).)

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