Differences between revisions 22 and 24 (spanning 2 versions)
Revision 22 as of 2011-07-03 00:56:23
Size: 2163
Editor: GeoffSimmons
Comment: InterWiki.
Revision 24 as of 2011-07-03 18:24:40
Size: 3146
Comment:
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
A [[WikiPedia:Daemon_(computing)|daemon]], or 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: <<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:
Line 10: Line 12:
## If your page gets really long, uncomment this Table of Contents
## <<TableOfContents(2)>>
== Managing 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]].
Line 13: Line 15:
== Managing 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 RunLevel.

== Daemon configuration ==
Line 19: Line 17:
=== Start, stop and reload daemons ===
The easiest way to manually (and temporarily) start, stop or reload a daemon is to run the following in a terminal as root:
=== Common 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:
Line 22: Line 20:
# /etc/init.d/daemonname [stop|start|restart] # /etc/init.d/ssh restart
Restarting OpenBSD Secure Shell server: sshd.
Line 24: Line 23:
Controlling daemons in this manner is temporary and will not survive a reboot. Refer to the next section to manage daemons on a more permanent basis. A brief description of each option 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 26: Line 30:
=== Enable/disable daemons === Stopping and starting daemons in this manner is temporary and will not survive a reboot. Refer to the next section to enable/disable daemons on a more permanent basis.
Line 28: Line 32:
=== Add/remove daemons ===
The terms ''add'' and ''remove'' are a bit of a misnomer because we're not actually adding or removing the services from Debian, rather we're enabling or disabling them.

Several tools exist to manage system services, including DebianPkg:rcconf and DebianPkg:sys-v-conf. The default tool however is '''update-rc.d'''.

==== Disabling services ====
To disable a service, run the following in a terminal as root:
{{{
# update-rc.d -f <servicename> remove
}}}

==== Enabling services ====
To (re)enable a service, using the default settings, run the following:
{{{
# update-rc.d <servicename> defaults
}}}

For detailed information on what these commands do, refer to the '''update-rc.d''' manpage.

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

Managing 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.

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.

Common 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 each option 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

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

Add/remove daemons

The terms add and remove are a bit of a misnomer because we're not actually adding or removing the services from Debian, rather we're enabling or disabling them.

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

Disabling services

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

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

Enabling services

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

# update-rc.d <servicename> defaults

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

See also