in reply to how to make a demon in perl?

According to Addison Wesley's "Network Programming with Perl" book your program should do the following:
  1. Put itself into the background
  2. Close STDIN, STDOUT, and STDERR
  3. Completely dissacociate from the controlling terminal
  4. Change the current working directory to /
  5. Change the file creation mask to a known state
  6. Normalize the PATH environment variable
  7. Write the process IDs to a file in /var/run or a similar location
You can learn more about the book here. For anyone wanting to download the example source code you want Chapter 10 (for anyone reading the book, it starts on page 312). Looks like the author (Lincoln D. Stein, the author of CGI.pm) uses the POSIX module mentioned above. -- Argel
  • Comment on According to Network Programming with Perl...