The Daemon class provides the infrastructure to implement robust daemon processes. A daemon process is implemented by deriving from senf::Daemon and implementing the necessary (virtual) member functions.
The startup procedure is divided into three steps: \li First, configure() is called. configure() should be as simple as possible. It just needs to set the daemon parameters. No further setup should be done here. \li init() is called after fork() but while still connected to the terminal. init() should do all necessary application setup. Here, all configuration or user errors should be detected and properly diagnosed. \li After init() returns, the application will detach from the terminal. Now run() is called to enter the application main loop. Since there are times, where separating init() and run() into two separate functions is difficult, instead of defining init() and run(), the member main() may be defined. This member must call detach() as soon as initialization is completed to detach from the foreground terminal.
\see \ref senf::Daemon class \n \ref SENF_DAEMON_MAIN() main() implementation macro