1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
|
.\" Hey, Emacs! This is an -*- nroff -*- source file.
.\" Authors: Ian Jackson, Miquel van Smoorenburg, Roland Rosenfeld
.TH UPDATE\-RC.D 8 "March 2004" "Debian Project" "file-rc"
.SH NAME
update\-rc.d \- modify runlevel.conf to manage System-V init scripts
.SH SYNOPSIS
.B update\-rc.d
.RI [ -n ]
.RI [ -f ]
.IB name " remove"
.HP
.B update-rc.d
.RI [ -n ]
.IB name " defaults"
.RI [ NN " | " NN-start " " NN-stop ]
.HP
.B update-rc.d
.RI [ -n ]
.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
.IR /etc/runlevel.conf (5),
a config file, which simulates the System V style init script links in
only one text file. These are run by
.BR init (8)
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
.BR init (8)
to decide which order to run the scripts in.
.P
This manpage documents only the usage and behaviour of
.BR update-rc.d (8).
For a discussion of the System V style init script arrangements please
see
.BR init (8),
.BR runlevel.conf (5),
and the
.IR "Debian Policy Manual" .
.SH INSTALLING INIT SCRIPTS
When run with either the
.BR defaults ", " start ", or " stop
options, update-rc.d adds a line to
.I /etc/runlevel.conf
pointing to the script
.BI /etc/init.d/ name\fR.
If any line pointing to
.I name
already exist then
.B update-rc.d
does nothing. This is so that the system administrator can rearrange
the configuration, provided that they leave at least one entry
remaining, without having their configuration overwritten.
If
.B defaults
is used then
.B update-rc.d
adds an entry to start the service in runlevels
.BR 2 , 3 , 4 , 5
and stop the service in runlevels
.BR 0 , 1 , 6 .
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 entries whereas of two arguments the first overrides the code for
start runlevels and the second that for stop runlevels.
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 runlevel entries are to be created by
that set. Then follows
.IR NN ,
the sequence code number for that line in
.IR /etc/runlevel.conf ,
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 lines from
.I /etc/runlevel.conf
pointing 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.
.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 line into runlevel.conf 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/runlevel.conf
The file containing the information 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 "Debian Policy Manual" ,
.br
.BR /etc/init.d/skeleton ,
.br
.BR init (8),
.br
.BR runlevel.conf (5).
|