Differences between revisions 2 and 26 (spanning 24 versions)
Revision 2 as of 2005-02-07 09:56:50
Size: 3383
Editor: anonymous
Comment:
Revision 26 as of 2011-07-03 19:34:30
Size: 3482
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## Auto-converted by kwiki2moinmoin v2005-10-07
Pronunciation:{{{
 day'mn or dee'mn
#language en
~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: English-~
----
<<TableOfContents>>
== What is a daemon? ==
A [[WikiPedia:Daemon_(computing)|daemon]], or system service, is a background process usually started during the initial boot sequence by [[init]]. Daemons typically run independent of users, waiting for system events to occur and providing services in response. Some common daemons include:

 * sshd - listens for and manages incoming [[ssh|SSH]] connections
 * [[acpid]] - listens for power management events and executes scripts based on them
 * [[Apache|apache]] - provides a local HTTP web server

== Daemons in Debian ==
Debian makes use of [[WikiPedia:Init#SysV-style|System V]]-style init scripts for daemon management. This allows daemons to operate conditionally, based on the current RunLevel of the computer. For example, a daemon can be configured to run only when the computer is in single-user mode (runlevel 1) or, more commonly, when in multi-user mode (runlevels 2-5). For more information, see [[init]] and [[RunLevel]].

== Managing Daemons ==
=== A brief introduction to Debian init scripts ===
Daemon init scripts are stored in {{{/etc/init.d/}}}

When a daemon is enabled or disabled, symbolic links targeting the respective init script are created or removed under the various {{{/etc/rc*.d/}}} directories, corresponding to the RunLevel(s) in which the daemon is to run.

To view a list of currently available services:
{{{
$ ls /etc/init.d
Line 6: Line 26:
From the mythological meaning, later rationalized as the acronym `Disk And Execution ["MONitor"]'. === Common service tasks ===
Most system services accept a common set of options, which can be passed directly to the daemon script at the command line, for example:
{{{
# /etc/init.d/ssh restart
Restarting OpenBSD Secure Shell server: sshd.
}}}
A brief description of the most common options follows:
 * '''start''': start a service
 * '''stop''': stop a service
 * '''restart''': restart a service without reloading its job config file
 * '''reload''': send a SIGHUP signal to running process
 * '''status''': return the status of a service
Line 8: Line 39:
A program that is not invoked explicitly, but lies dormant waiting for some condition(s) to occur. The idea is that the perpetrator of the condition need not be aware that a daemon is lurking (though often a program will commit an action only because it knows that it will implicitly invoke a daemon). For example, under ITS writing a file on the LPT spooler's directory would invoke the spooling daemon, which would then print the file. The advantage is that programs wanting (in this example) files printed need neither compete for access to nor understand any idiosyncrasies of the LPT. They simply enter their implicit requests and let the daemon decide what to do with them. Daemons are usually spawned automatically by the system, and may either live forever or be regenerated at intervals. Daemon and demon are often used interchangeably, but seem to have distinct connotations. The term `daemon' was introduced to computing by CTSS people (who pronounced it ''dee'mon'') and used it to refer to what ITS called a dragon; the prototype was a program called DAEMON that automatically made tape backups of the file system. Although the meaning and the pronunciation have drifted, we think this glossary reflects current (2000) usage. From Jargon Dictionary http://www.tldp.org/LDP/Linux-Dictionary/html/index.html Starting and stopping daemons in this manner is temporary and will not survive a reboot. Refer to the next section to enable/disable daemons on a permanent basis.
Line 10: Line 41:
A background process of the operating system that usually has root security level permission. A daemon usually lurks in the background until something triggers it into activity, such as a specific time or date, time interval, receipt of e-mail, etc. From I-gloss http://www.tldp.org/LDP/Linux-Dictionary/html/index.html === Enable/disable daemons ===
''Note: Many daemons provide essential services to a working Debian installation; others can pose unnecessary security risks when enabled carelessly. Caution should be used whenever managing daemons. When in doubt, refer to the documentation of the daemon itself.''
Line 12: Line 44:
A process lurking in the background, usually unnoticed, until something triggers it into action. For example, the \cmd{update} daemon wakes up every thirty seconds or so to flush the buffer cache, and the \cmd{sendmail} daemon awakes whenever someone sends mail. http://www.tldp.org/LDP/Linux-Dictionary/html/index.html Several tools exist to manage system services, including DebianPkg:rcconf and DebianPkg:sys-v-conf. The default tool however is '''update-rc.d''' and that is what the following examples use.
Line 14: Line 46:
A program that runs continuously in the background, until activated by a particular event. A daemon can constantly query for requests or await direct action from a user or other process. From Redhat-9-Glossary http://www.tldp.org/LDP/Linux-Dictionary/html/index.html ==== Enabling services ====
To (re)enable a service, using the default settings, run the following:
{{{
# update-rc.d <servicename> defaults
}}}
Line 16: Line 52:
==== Disabling services ====
To disable a service, run the following in a terminal as root:
{{{
# update-rc.d -f <servicename> remove
}}}
Line 17: Line 58:
A program which runs for an extended period (usually "forever") to handle requests for service as needed. From Linux Guide @FirstLinux http://www.tldp.org/LDP/Linux-Dictionary/html/index.html For more detail on what these commands do, refer to the [[DebianMan:8/update-rc.d|update-rc.d manpage]].
Line 19: Line 60:
A program, usually on a computer running UNIX, that serves some obscure function (such as routing electronic mail to its recipients) and usually has a very limited user interface. There's some debate about the origins of the word, but most say it derives from the devilish spirits of Greek mythology. From QUECID http://www.tldp.org/LDP/Linux-Dictionary/html/index.html == See also ==
 * [[init]]
 * [[RunLevel]]
 * manpages: [[DebianMan:5/inittab|inittab]],[[DebianMan:8/init|init]],[[DebianMan:5/rcS|rcS]], [[DebianMan:8/update-rc.d|update-rc.d]], [[DebianMan:8/runlevel|runlevel]]
Line 21: Line 65:
Disk And Execution ["MONitor"] (Unix) From VERA http://www.tldp.org/LDP/Linux-Dictionary/html/index.html

Daemon (service)
On ["UNIX"], a daemon is a program running in the background, usually providing some sort of service. Typical daemons are those that provide e-mail, printing, telnet, FTP, and web access. From Hacking-Lexicon http://www.tldp.org/LDP/Linux-Dictionary/html/index.html
----
## If this page belongs to an existing Category, add it below.
## CategorySomething | CategoryAnother

Translation(s): English


What is a daemon?

A daemon, or system service, is a background process usually started during the initial boot sequence by ?init. Daemons typically run independent of users, waiting for system events to occur and providing services in response. Some common daemons include:

  • sshd - listens for and manages incoming ?SSH connections

  • acpid - listens for power management events and executes scripts based on them

  • apache - provides a local HTTP web server

Daemons in Debian

Debian makes use of System V-style init scripts for daemon management. This allows daemons to operate conditionally, based on the current RunLevel of the computer. For example, a daemon can be configured to run only when the computer is in single-user mode (runlevel 1) or, more commonly, when in multi-user mode (runlevels 2-5). For more information, see ?init and RunLevel.

Managing Daemons

A brief introduction to Debian init scripts

Daemon init scripts are stored in /etc/init.d/

When a daemon is enabled or disabled, symbolic links targeting the respective init script are created or removed under the various /etc/rc*.d/ directories, corresponding to the RunLevel(s) in which the daemon is to run.

To view a list of currently available services:

$ ls /etc/init.d

Common service tasks

Most system services accept a common set of options, which can be passed directly to the daemon script at the command line, for example:

# /etc/init.d/ssh restart
Restarting OpenBSD Secure Shell server: sshd.

A brief description of the most common options follows:

  • start: start a service

  • stop: stop a service

  • restart: restart a service without reloading its job config file

  • reload: send a SIGHUP signal to running process

  • status: return the status of a service

Starting and stopping daemons in this manner is temporary and will not survive a reboot. Refer to the next section to enable/disable daemons on a permanent basis.

Enable/disable daemons

Note: Many daemons provide essential services to a working Debian installation; others can pose unnecessary security risks when enabled carelessly. Caution should be used whenever managing daemons. When in doubt, refer to the documentation of the daemon itself.

Several tools exist to manage system services, including rcconf and sys-v-conf. The default tool however is update-rc.d and that is what the following examples use.

Enabling services

To (re)enable a service, using the default settings, run the following:

# update-rc.d <servicename> defaults

Disabling services

To disable a service, run the following in a terminal as root:

# update-rc.d -f <servicename> remove

For more detail on what these commands do, refer to the update-rc.d manpage.

See also