How do you write a daemon?

Linh Chi

New member
How do you write a daemon?
Answer
This involves a few steps:
  1. Fork off the parent process.
  2. Change file mode mask (umask)
  3. Open any logs for writing.
  4. Create a unique Session ID (SID)
  5. Change the current working directory to a safe place.
  6. Close standard file descriptors.
  7. Enter actual daemon code.
 

Tìm kiếm

Back
Top