| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- .\" Hey, Emacs! This is an -*- nroff -*- source file.
- .\" Authors: Ian Jackson
- .TH UPDATE\-RC.D 8 "2 March 1998" "Debian Project" "Debian/GNU Linux"
- .SH NAME
- update\-rc.d \- install and remove System-V style init script links
- .SH SYNOPSIS
- .B update\-rc.d
- .RI [ -n ]
- .RI [ -f ]
- .IB name " remove"
- .HP
- .B update-rc.d
- .RI [ -n ]
- .RI [ -f ]
- .IB name " defaults"
- .RI [ NN " | " NN-start " " NN-stop ]
- .HP
- .B update-rc.d
- .RI [ -n ]
- .RI [ -f ]
- .I name
- .BR start | stop
- .IR "NN runlevel runlevel " ...
- .B .
- .BR start | stop
- .IR "NN runlevel runlevel " ...
- .BR . " ..."
- .SH DESCRIPTION
- .B update-rc.d
- automatically updates the System V style init script links
- .BI /etc/rc runlevel .d/ NNname
- to scripts
- .BI /etc/init.d/ name \fR.
- These are run by
- .B init
- when changing runlevels and are generally used to start and stop
- system services such as daemons.
- .I runlevel
- is one of the runlevels supported by
- .BR init ", " 0123456789S ,
- and
- .I NN
- is the two-digit sequence code used by
- .B init
- to decide which order to run the scripts in.
- This manpage documents only the usage and behaviour of
- .BR update-rc.d .
- For a discussion of the System V style init script arrangements please
- see
- .BR init (8)
- and the
- .IR "dpkg programmers' manual" .
- .SH INSTALLING INIT SCRIPT LINKS
- When run with either the
- .BR defaults ", " start ", or " stop
- options, update-rc.d makes links
- .BI /etc/rc runlevel .d/[SK] NNname
- pointing to the script
- .BI /etc/init.d/ name\fR,
- If any files
- .BI /etc/rc runlevel .d/[SK]?? name
- already exist then
- .B update-rc.d
- does nothing. This is so that the system administrator can rearrange
- the links, provided that they leave at least one link remaining,
- without having their configuration overwritten.
- If
- .B defaults
- is used then
- .B update-rc.d
- will make links to start the service in runlevels
- .B 2345
- and stop the service in runlevels
- .BR 016 .
- By default all the links will have sequence code 20, but
- this can be overridden by supplying one or two
- .I NN
- arguments; one argument overrides the sequence code for both start and
- stop links whereas of two arguments the first overrides the code for
- start links and the second that for stop links.
- Instead of
- .B defaults
- the runlevels in which to start and stop the service may be specified
- explicitly using a series of sets of arguments:
- Each of these sets starts with an argument
- .BR start " or " stop
- to specify whether start or stop links are to be created by that set.
- Then follows
- .IR NN ,
- the sequence code number for all the links in the set, and one or more
- runlevel numbers as a single argument each. The set is terminated by
- an argument
- .B .
- (a single full stop).
- When explicit specification, rather than
- .BR defaults ,
- is used there will usually be one
- .B start
- and one
- .B stop
- set. If different sequence codes are required in different runlevels
- then several
- .B start
- sets or several
- .B stop
- sets may be specified.
- The script
- .BI /etc/init.d/ name
- must exist before
- .B update-rc.d
- is run to create the links.
- .SH REMOVING SCRIPTS
- When invoked with the
- .I remove
- option, update-rc.d removes any links in the
- .BI /etc/rc runlevel .d
- directories to the script
- .BI /etc/init.d/ name\fR.
- The script must have been deleted already -
- .B update-rc.d
- checks for this.
- .B update-rc.d
- is usually called from a package's post-removal script when that
- script detects that its first argument is
- .BR purge ,
- indicating that the user has requested the configuration for the
- package to be removed.
- Any files in the
- .BI /etc/rc runlevel .d
- directories that are not symbolic links to the script
- .BI /etc/init.d/ name
- will be left untouched.
- .SH OPTIONS
- .TP
- .I -n
- Don't do anything, just show what we would do.
- .TP
- .I -f
- Force removal of symlinks even if
- .BI /etc/init.d/ name
- still exists.
- .SH EXAMPLES
- Insert links using the defaults:
- .nf
- .B " update-rc.d foobar defaults"
- .fi
- Equivalent command using explicit argument sets:
- .nf
- .B " update-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 ."
- .fi
- .SH BUGS
- There should be a way for the system administrator to specify at least
- the default start and stop runlevels to be used by
- .B defaults
- and possibly to override other things as well.
- .SH FILES
- .TP
- .B /etc/init.d/
- The directory containing the actual init scripts.
- .TP
- .B /etc/rc?.d/
- The directories containing the links used by
- .BR init
- and managed by
- .BR update-rc.d .
- .TP
- .B /etc/init.d/skeleton
- Model for use by writers of
- .B init.d
- scripts.
- .SH SEE ALSO
- .IR "dpkg programmers manual" ,
- .br
- .BR /etc/init.d/skeleton ,
- .br
- .BR init (8).
|