Slashdot Mirror


Daemon Processes Explored

mukul inputs: "I've written a comprehensive article about daemon processes on UNIX systems, and how to program them efficiently so that zombie processes are avoided, and how to maintain the code adhering to the POSIX standard." You may have to grab a copy of the article source because the submittor forgot to replace his angled brackets with "<" / ">" pairs, so things like include statements and other bits of text will get mangled by your browser. Still, it looks to be a decent writeup. What aspects of daemon programming (if any) is it missing that other readers might do well to know?

6 comments

  1. testing by khuber · · Score: 1

    testing - ignore

  2. no mention of init based deamons? by thogard · · Score: 1

    If you run the sample code from init, you will find init keeps spawning till it shuts off.
    Good deamon code should check to see if its ppid==1 and not fork in that case.

  3. You could read this article or you could... by selectspec · · Score: 2

    ...learn about forking and most of what you need to know when programming unix by reading "Advanced Programming in the Unix Environment" by Stevens.

    --

    Someone you trust is one of us.

    1. Re:You could read this article or you could... by darthtuttle · · Score: 1

      I can't stress this enough, so it needs to be said again. READ ADVANCED PROGRAMMING IN THE UNIX ENVIRONMENT by Stevens, then read Unix Network Programming and TCP/IP Illustrated :)
      --
      Darthtuttle
      Thought Architect

      --
      Darthtuttle
      Thought Architect
  4. Colours by gwyrdd+benyw · · Score: 1

    The submittor should also be aware that reading light grey text on a dark grey background can be brutal on the eyes. :)

    --

    I adblock all animated gifs.
    Blessed be the prime numbered slashdotters
  5. Great! by sachachua · · Score: 1

    Good work, mukul. It's nice that you're writing these things up - helps other people as well as trains writing skills. The Unix programming books cover fork in great detail, but your page is handy just in case I don't have a book around.. =)