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?
testing - ignore
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.
...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.
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
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.. =)