Wednesday, November 07, 2007
Unix Daemons in Perl
The word daemon is derived from the Greek word daimon, meaning a "supernatural being" or "spirit", rather than demon, referring to the fallen angels or followers of Satan. Some would insist that Unix is infested with both daemons and demons. In Unix, daemons are typically started by the root process when the operating system is initialized, and run in the background indefinitely. Daemons typically spend most of their time waiting for an event or period when they will perform some task. Examples of common Internet daemons include WU-Ftpd, Apache, BIND, and Sendmail. These particular daemon programs are responsible in part for making the Internet useful, but daemons also serve other purposes that are not as visible to users. In this tutorial, we'll learn how easy it is to turn a Perl script into a daemon process.