Daemon (computer software)

Daemon (computer software)

In Unix and other computer multitasking operating systems, a daemon (pronEng|ˈdiːmən or IPA|/ˈdeɪmən/ [cite web |url=http://foldoc.org/index.cgi?query=daemon |title=Jargon File entry for daemon |last=Raymond |first=Eric |accessdate=2007-07-18 |work=The Jargon File ] ) is a computer program that runs in the background, rather than under the direct control of a user; they are usually initiated as background processes. Typically daemons have names that end with the letter "d": for example, syslogd, the daemon that handles the system log, or sshd, which handles incoming SSH connections.

In a Unix environment, the parent process of a daemon is often (but not always) the init process (PID=1). Processes usually become daemons by forking a child process and then having their parent process immediately exit, thus causing init to adopt the child process. This is a somewhat simplified view of the process as other operations are generally performed, such as disassociating the daemon process from any controlling tty. Convenience routines such as daemon(3) exist in some UNIX systems for that purpose.

Systems often start (or "launch") daemons at boot time: they often serve the function of responding to network requests, hardware activity, or other programs by performing some task. Daemons can also configure hardware (like devfsd on some Linux systems), run scheduled tasks (like cron), and perform a variety of other tasks.

Terminology

The term was coined by the programmers of MIT's Project MAC. They took the name from Maxwell's demon, an imaginary being from a famous thought experiment that constantly works in the background, sorting molecules. [cite web|url=http://www.takeourword.com/TOW146/page4.html|author=Fernando J. Corbató|title=Take Our Word for It|date=2002-01-23|accessdate=2006-08-20] Unix systems inherited this terminology. Daemons are also characters in Greek mythology, some of whom handled tasks that the gods could not be bothered with, much as computer daemons often handle tasks in the background that the user cannot be bothered with. BSD and some of its derivatives have adopted a daemon as its mascot, although this mascot is actually a cute stereotypical depiction of a demon from Christianity.

Pronunciation

The word "daemon", taken out of its computer science context, is correctly pronounced as IPA|/'dimən/ "(DEE-men)" [cite web |url=http://www.yourdictionary.com/ahd/d/d0004600.html |title=YourDictionary entry for daemon |accessdate=2007-07-18 |work=YourDictionary ] [cite web | url=http://dictionary.reference.com/browse/daemon |title=Dictionary.com entry for daemon |accessdate=2007-07-18 |work=Dictionary.com] [cite web |url=http://www.m-w.com/cgi-bin/audio.pl?demon001.wav=daemon |title=Merriam-Webster pronuncation of daemon |accessdate=2007-07-18 |work=Merriam-Webster Online] , i.e., as a homonym of the word "demon". Perhaps due to the relative obscurity of the word in other contexts, it is not uncommon to hear it mispronounced as IPA|/'deɪmən/ "(DAY-men)".

Types of daemons

In a strictly technical sense, in the Unix world, a process comprises a daemon when it has process number 1 (init) as its parent process and no controlling terminal. The init process adopts any process whose parent process terminates. The common method for a process to become a daemon involves:
* Disassociating from the controlling tty
* Becoming a session leader
* Becoming a process group leader
* Staying in the background by forking and exiting (once or twice). This is required sometimes for the process to become a session leader. It also allows the parent process to continue its normal execution. This idiom is sometimes summarized with the phrase "fork off and die"
* Setting the root directory ("/") as the current working directory so that the process will not keep any directory in use that may be on a mounted file system (allowing it to be unmounted).
* Changing the umask to 0 to allow open(), creat(), et al. calls to provide their own permission masks and not to depend on the umask of the caller
* Closing all inherited open files at the time of execution that are left open by the parent process, including file descriptors 0, 1 and 2 (stdin, stdout, stderr). Required files will be opened later.
* Using a logfile, the console, or /dev/null as stdin, stdout, and stderr

In common Unix usage a daemon may be any background process, whether a child of init or not. Unix users sometimes spell daemon as "demon", and most usually pronounce the word that way.

Windows equivalent

In the Microsoft DOS environment, such programs were written as Terminate and Stay Resident (TSR) software. On Microsoft Windows systems, programs called "services" perform the functions of daemons. They run as processes, usually do not interact with the monitor, keyboard, and mouse, and may be launched by the operating system at boot time. Starting with Windows NT and in later systems, one can configure and manually start and stop Windows services using the Control Panel -> Services applet.

Mac OS equivalent

On the original Mac OS, optional features and services were provided by files loaded at startup time that patched the operating system; these were known as system extensions and control panels. Later versions of classic Mac OS augmented these with fully-fledged faceless background applications: regular applications that ran in the background. To the user, these were still described as regular system extensions.

Mac OS X, being a Unix-like system, has daemons. There is a category of software called "services" as well, but these are different in concept to Windows' services.

Etymology

In the general sense, daemon is an older form of the word demon. In the Unix System Administration Handbook, Evi Nemeth states the following about daemons: [ [http://www.freebsd.org/copyright/daemon.html The BSD Daemon ] ]

Many people equate the word "daemon" with the word "demon", implying some kind of satanic connection between UNIX and the underworld. This is an egregious misunderstanding. "Daemon" is actually a much older form of "demon"; daemons have no particular bias towards good or evil, but rather serve to help define a person's character or personality. The ancient Greeks' concept of a "personal daemon" was similar to the modern concept of a "guardian angel" — "eudaemonia" is the state of being helped or protected by a kindly spirit. As a rule, UNIX systems seem to be infested with both daemons and demons. (p.403)

References

ee also

* Server
* List of computer term etymologies
* Windows service
* Terminate and Stay Resident
* User space
* NTVDM
* Apcupsd
* Windows Workflow Foundation
* Runtime DLL, COM Library
* Microsoft Services

External links

* [http://www.annodex.net/cgi-bin/man/man2html?start-stop-daemon+8 start-stop-daemon man page] (Debian package)
* [http://www.webreference.com/perl/tutorial/9/ Tutorial: Unix Daemons in Perl]
* [http://www-theorie.physik.unizh.ch/~dpotter/howto/daemonize How to daemonize in Linux]
* [http://www.enderunix.org/docs/eng/daemon.php Unix Daemon Server Programming]
* [http://web.archive.org/web/20051216101425/http://lug.umbc.edu/~mabzug1/bash-httpd.html http daemon in Bash]
* [http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/cl/rpcbind.htm IBM RPCBIND] , See interrupter, encoder/decoder/descriptor (of assembly code), JVM (background services)


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Background (computer software) — The background, in the context of computer software processes, refers in general to processes that are running with a relatively low priority, require little or no input, and generate a minimum of output.Background processes can roughly be… …   Wikipedia

  • Software versioning — is the process of assigning either unique version names or unique version numbers to unique states of computer software. Within a given version number category (major, minor), these numbers are generally assigned in increasing order and… …   Wikipedia

  • Daemon (computing) — For other uses, see Daemon (disambiguation). In Unix and other multitasking computer operating systems, a daemon (  /ˈdeɪ …   Wikipedia

  • Computer-Betriebssystem — Ein Betriebssystem ist die Software, die die Verwendung (den Betrieb) eines Computers ermöglicht. Es verwaltet Betriebsmittel wie Speicher, Ein und Ausgabegeräte und steuert die Ausführung von Programmen. Betriebssystem heißt auf Englisch… …   Deutsch Wikipedia

  • DAEMON Tools — Lite Entwickler: DT Soft Ltd. Aktuelle Version: 4.30.3 (29. Dezember 2008) Betriebssystem: Microsoft Windows Kategorie: CD /DVD Emulation …   Deutsch Wikipedia

  • DAEMON Tools Lite — Entwickler: DT Soft Ltd. Aktuelle Version: 4.30.3 (29. Dezember 2008) Betriebssystem: Microsoft Windows Kategorie: CD /DVD Emulation …   Deutsch Wikipedia

  • DAEMON Tools Pro — Daemon Tools Lite Entwickler: DT Soft Ltd. Aktuelle Version: 4.30.3 (29. Dezember 2008) Betriebssystem: Microsoft Windows Kategorie: CD /DVD Emulation …   Deutsch Wikipedia

  • Daemon-Tools — Lite Entwickler: DT Soft Ltd. Aktuelle Version: 4.30.3 (29. Dezember 2008) Betriebssystem: Microsoft Windows Kategorie: CD /DVD Emulation …   Deutsch Wikipedia

  • Daemon Tools Pro — Daemon Tools Lite Entwickler: DT Soft Ltd. Aktuelle Version: 4.30.3 (29. Dezember 2008) Betriebssystem: Microsoft Windows Kategorie: CD /DVD Emulation …   Deutsch Wikipedia

  • Daemon tools — Lite Entwickler: DT Soft Ltd. Aktuelle Version: 4.30.3 (29. Dezember 2008) Betriebssystem: Microsoft Windows Kategorie: CD /DVD Emulation …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”