update-rc.d(8)

update-rc.d8

Install and remove system-v style init script links

Usage

update-rc.d [-f] name remove

update-rc.d name defaults

update-rc.d name defaults-disabled

update-rc.d {name disable | enable [{S | 2 | 3 | 4 | 5}]}

Overview

update-rc.d updates the System V style init script links /etc/rcrunlevel.d/NNname whose target is the script /etc/init.d/name. These links are run by init when it changes runlevels; they are generally used to start and stop system services such as daemons. runlevel is one of the runlevels supported by init, namely, 0123456789S, and NN is the two-digit sequence number that determines where in the sequence init will run the scripts.

This manpage documents only the usage and behaviour of update-rc.d. For a discussion of the System V style init script arrangements please see init(8) and the Debian Policy Manual.

Removing scripts

When invoked with the remove option, update-rc.d removes any links in the /etc/rcrunlevel.d directories to the script /etc/init.d/name. The script must have been deleted already. If the script is still present then update-rc.d aborts with an error message. .P update-rc.d is usually called from a package's post-removal script when that script is given the purge argument. Any files in the /etc/rcrunlevel.d directories that are not symbolic links to the script /etc/init.d/name will be left untouched.

Options

-f

Force removal of symlinks even if /etc/init.d/name still exists.

Examples

Insert links using the defaults:

update-rc.d foobar defaults

The equivalent dependency header would have start and stop dependencies on $remote_fs and $syslog, and start in runlevels 2-5 and stop in runlevels 0, 1 and 6.

Remove all links for a script (assuming foobar has been deleted already):

update-rc.d foobar remove

Example of disabling a service:

update-rc.d foobar disable

Example of a command for installing a system initialization-and-shutdown script:

update-rc.d foobar defaults

Example of a command for disabling a system initialization-and-shutdown script:

update-rc.d foobar disable

Files

/etc/init.d/

The directory containing the actual init scripts.

/etc/rc?.d/

The directories containing the links used by init and managed by update-rc.d .

/etc/init.d/skeleton

Model for use by writers of init.d scripts.

Releases

18 releases since Debian 1.1 (Buzz); the text changed 13 times.

  1. 1.1
  2. 1.2–1.3
  3. 2.0
  4. 2.1–2.2
  5. 3.0
  6. 3.1
  7. 4.0–5.0
  8. 6.0
  9. 7
  10. 8–9
  11. 10
  12. 11
  13. 12
  14. 13

-f since Debian 2.1 (Slink).

-n until Debian 9 (Stretch).

Bugs

See <http://bugs.debian.org/sysv-rc> and
<http://bugs.debian.org/init-system-helpers> .

Author

Ian Jackson, Miquel van Smoorenburg

License: GNU General Public License v2 or Later (GPLv2+)

From init-system-helpers 1.69~deb13u1 in Debian 13 (Trixie). Parsed by carta from the page's man source.