Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs


More on LinuxToday


Creating a Daemon With Python

Nov 21, 2008, 00:03 (0 Talkback[s])
(Other stories by Jeremy M. Jones)

"Daemon Defined

"A daemon is a process on UNIX that runs in the background and will typically keep running until it is explicitly told to stop. Examples of daemon processes include web servers (lighttpd and Apache httpd), schedulers (cron and at), DNS servers (bind), mail servers (courier and dovecot), and database servers (MySQL and PostgreSQL).

"The typical web user will probably interact with at least one UNIX daemon in the form of a web server, DNS server, or database server on an average day. These types of processes run in the background on a server somewhere, unattended by any person, working tirelessly to do the work that they were designed for.

"You can background a process on UNIX by putting an ampersand (&) at the end of the command that you started it with. For example:

"dink:~ jmjones$ $(sleep 10; echo echo "WAKING UP";) & [1] 314

dink:~ jmjones$ WAKING UP

This backgrounded the sleep and echo commands. Ten seconds later, after sleep completed, the command echoed "WAKING UP" and appeared on my terminal. But just running a process in the background doesn't qualify it for daemon status. There are some deeper technical qualifications that an aspiring process has to meet in order to be branded with the daemon label."

Complete Story

Related Stories: