==================
== beto's notes ==
==================

Systems Programming

Daemons

Double-fork technique

  1. The parent process forks and exits.
  2. Child process creates a new session via setsid() and becomes a new session leader.
  3. In the new session it forks again (grandchildren) to prevent attaching to a terminal. Here is where the daemon itself gets executed.

Additional Resources

Books