LIBSSDP
 All Classes Files Functions Variables Typedefs Macros
Functions
daemon.c File Reference
#include <stdlib.h>
#include <signal.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "common_definitions.h"
#include "log.h"
Include dependency graph for daemon.c:

Go to the source code of this file.

Functions

void daemonize ()
 

Detailed Description

Functions for making the process a daemon.

Definition in file daemon.c.

Function Documentation

void daemonize ( void  )

Prepares the process to run as a daemon.

Daemon preparation steps:

  1. Set up rules for ignoring all (tty related) signals that can stop the process
  2. Fork to child and exit parent to free the terminal and the starting process
  3. Change PGID to ignore parent stop signals and disassociate from controlling terminal (two solutions, normal and BSD)

Definition at line 21 of file daemon.c.