MissingH-1.6.0.1: Large utility library
CopyrightCopyright (C) 2005-2011 John Goerzen
LicenseBSD-3-Clause
Stabilitystable
Portabilityportable to platforms with POSIX process\/signal tools
Safe HaskellTrustworthy
LanguageHaskell2010

System.Daemon

Description

Tools for writing daemons/server processes

Written by John Goerzen, jgoerzen@complete.org

Messages from this module are logged under System.Daemon. See Logger for details.

This module is not available on Windows.

Synopsis

Documentation

detachDaemon :: IO () Source #

Detach the process from a controlling terminal and run it in the background, handling it with standard Unix deamon semantics.

After running this, please note the following side-effects:

  • The PID of the running process will change
  • stdin, stdout, and stderr will not work (they'll be set to /dev/null)
  • CWD will be changed to /

I highly suggest running this function before starting any threads.

Note that this is not intended for a daemon invoked from inetd(1).