Fill in the Daemon Creation Functionality

To properly create create a Daemon it needs to accomplish the following tasks.

  • Fork the process and exit.
  • Create a new session with a new process group and become the session leader and process group leader.
  • Fork the process and exit again to no longer be the session leader and a TTY cannot accidentally be take control of it.
  • Change the working directory of the program to the "/" directory, so it can not be unmounted.
  • Adjust the umask settings to not depend on the callers settings.
  • Close any inherited files if there are any like stdin, stdout, stderr.
2017-09-24
100% Completed
#5 by myrddin was closed 2017-10-11 01:08:55 -04:00