Daemontools
From Grokdoc
daemontools is D.J. Bernstein's package which run as a daemon. Daemontools is a collection of tools for managing UNIX services.
This is mostly used in conjunction with qmail, however it can be used by a lot of things.
Daemontools run in the background, and supervises an applications, if this application unexpectdly dies, in any sort of way, which can include you using the kill command, it will restart the service within 5 seconds.
Daemontools provides tcpserver, which is an application that reads everything from the internet, and then feeds it over stdout and stdin to the program that needs the info, which can be any program that reads and writes on stdout and stdin.
What this does it take away the internet code handling from the program itself, and lets it be a simple program that works just like any other program on the command line. This means that a programmer does not have to worry about sockets in his program, and can just write the program simple and straight forward.
It also includes multilog, which does exactly what the name implies, it logs. tcpserver sends any data it gets back from the program it just executed, to the stdin of multilog, which writes it to a file named "current" until that file contains to much data, which is when it rotates it out. Multilog will make sure writes succeeded by sending an fsync to the kernel, thus almost guaranteeing the data will be written to disk.


