Differences between revisions 35 and 37 (spanning 2 versions)
Revision 35 as of 2011-07-06 16:47:16
Size: 3899
Comment: added link to it translation
Revision 37 as of 2011-07-07 18:59:42
Size: 4074
Comment: redundant info
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
== Managing Daemons == == Daemon management ==
Line 18: Line 18:
Daemon init scripts are stored in {{{/etc/init.d/}}} Daemon init scripts are stored in {{{/etc/init.d/}}} along with the system's other boot-time init scripts.
Line 22: Line 22:
To view a list of currently available services:
{{{
$ ls /etc/init.d
}}}
Daemon init scripts are treated as configuration files by [[dpkg]]. This means they remain on the system after a package is uninstalled, unless the '{{{purge}}}' option is used.
Line 27: Line 24:
=== Common daemon options === === Common daemon controls ===
Line 45: Line 42:
Several tools exist to manage system services, including DebianPkg:rcconf and DebianPkg:sysv-rc-conf. The default tool however is '''update-rc.d''' and that is what the following examples use.
Line 50: Line 45:
# update-rc.d <daemon> defaults # update-rc.d <daemon> enable
Line 54: Line 49:
To disable a daemon at all runlevels, execute the following command, where ''<daemon>'' corresponds to the name of the init script as listed in {{{/etc/init.d/}}}: To disable a daemon at its default runlevels, execute the following command, where ''<daemon>'' corresponds to the name of the init script as listed in {{{/etc/init.d/}}}:
Line 56: Line 51:
# update-rc.d -f <daemon> remove # update-rc.d <daemon> disable
Line 60: Line 55:

=== GUI utilities for daemon management ===
Several GUI tools exist to make daemon management even simpler; some popular examples available for Debian include: DebianPkg:rcconf and DebianPkg:sysv-rc-conf.

Translation(s): English - Italiano


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.

The Debian Policy Manual (sections 9.3 and 9.4) is an excellent resource for better understanding daemon init scripts in Debian.

Daemon management

A brief introduction to Debian init scripts

Daemon init scripts are stored in /etc/init.d/ along with the system's other boot-time init scripts.

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.

Daemon init scripts are treated as configuration files by dpkg. This means they remain on the system after a package is uninstalled, unless the 'purge' option is used.

Common daemon controls

Most daemon scripts accept a common set of options, which can be passed directly to the 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.

Enabling daemons

To (re)enable a daemon (using the default settings) run the following command, where <daemon> corresponds to the name of the init script as listed in /etc/init.d/:

# update-rc.d <daemon> enable

Disabling daemons

To disable a daemon at its default runlevels, execute the following command, where <daemon> corresponds to the name of the init script as listed in /etc/init.d/:

# update-rc.d <daemon> disable

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

GUI utilities for daemon management

Several GUI tools exist to make daemon management even simpler; some popular examples available for Debian include: rcconf and sysv-rc-conf.

See also


CategoryBootProcess