| 1 |
.\" Man page generated from reStructuredText. |
| 2 |
. |
| 3 |
. |
| 4 |
.nr rst2man-indent-level 0 |
| 5 |
. |
| 6 |
.de1 rstReportMargin |
| 7 |
\\$1 \\n[an-margin] |
| 8 |
level \\n[rst2man-indent-level] |
| 9 |
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 10 |
- |
| 11 |
\\n[rst2man-indent0] |
| 12 |
\\n[rst2man-indent1] |
| 13 |
\\n[rst2man-indent2] |
| 14 |
.. |
| 15 |
.de1 INDENT |
| 16 |
.\" .rstReportMargin pre: |
| 17 |
. RS \\$1 |
| 18 |
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] |
| 19 |
. nr rst2man-indent-level +1 |
| 20 |
.\" .rstReportMargin post: |
| 21 |
.. |
| 22 |
.de UNINDENT |
| 23 |
. RE |
| 24 |
.\" indent \\n[an-margin] |
| 25 |
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 26 |
.nr rst2man-indent-level -1 |
| 27 |
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 28 |
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u |
| 29 |
.. |
| 30 |
.TH "UPDATE-RC.D" "8" "" "14 November 2005" "Debian GNU/Linux" |
| 31 |
.SH NAME |
| 32 |
update-rc.d \- install and remove System-V style init script links |
| 33 |
.SH SYNOPSIS |
| 34 |
.sp |
| 35 |
\fBupdate\-rc.d\fP [\fI\-f\fP] \fIname\fP \fBremove\fP |
| 36 |
.sp |
| 37 |
\fBupdate\-rc.d\fP \fIname\fP \fBdefaults\fP |
| 38 |
.sp |
| 39 |
\fBupdate\-rc.d\fP \fIname\fP \fBdefaults\-disabled\fP |
| 40 |
.sp |
| 41 |
\fBupdate\-rc.d\fP \fIname\fP \fBdisable|enable\fP [ \fIS|2|3|4|5\fP ] |
| 42 |
.SH DESCRIPTION |
| 43 |
.sp |
| 44 |
\fBupdate\-rc.d\fP updates the System V style init script links |
| 45 |
\fB/etc/rc\fP\fIrunlevel\fP\fB\&.d/\fP\fINNname\fP |
| 46 |
whose target is the script |
| 47 |
\fB/etc/init.d/\fP\fIname\fP\&. |
| 48 |
These links are run by |
| 49 |
\fBinit\fP |
| 50 |
when it changes runlevels; they are generally used to start and stop |
| 51 |
system services such as daemons. |
| 52 |
\fIrunlevel\fP |
| 53 |
is one of the runlevels supported by |
| 54 |
\fBinit\fP, namely, \fB0123456789S\fP, and |
| 55 |
\fINN\fP |
| 56 |
is the two\-digit sequence number that determines where in the sequence |
| 57 |
\fBinit\fP |
| 58 |
will run the scripts. |
| 59 |
.sp |
| 60 |
This manpage documents only the usage and behaviour of |
| 61 |
\fBupdate\-rc.d\fP\&. |
| 62 |
For a discussion of the System V style init script arrangements please |
| 63 |
see |
| 64 |
\fBinit\fP(8) |
| 65 |
and the |
| 66 |
\fIDebian Policy Manual\fP\&. |
| 67 |
.SH INSTALLING INIT SCRIPT LINKS |
| 68 |
.sp |
| 69 |
update\-rc.d requires dependency and runlevel information to be |
| 70 |
provided in the init.d script LSB comment header of all init.d scripts. |
| 71 |
See the insserv(8) manual page for details about the LSB header format. |
| 72 |
.sp |
| 73 |
When run with the |
| 74 |
\fBdefaults\fP |
| 75 |
option, |
| 76 |
\fBupdate\-rc.d\fP |
| 77 |
makes links named |
| 78 |
\fB/etc/rc\fP\fIrunlevel\fP\fB\&.d/[SK]\fP\fINNname\fP |
| 79 |
that point to the script |
| 80 |
\fB/etc/init.d/\fP\fIname\fP, |
| 81 |
using runlevel and dependency information from the init.d script LSB |
| 82 |
comment header. |
| 83 |
.sp |
| 84 |
When run with the |
| 85 |
\fBdefaults\-disabled\fP |
| 86 |
option, |
| 87 |
\fBupdate\-rc.d\fP |
| 88 |
makes links named |
| 89 |
\fB/etc/rc\fP\fIrunlevel\fP\fB\&.d/K\fP\fINNname\fP |
| 90 |
that point to the script |
| 91 |
\fB/etc/init.d/\fP\fIname\fP, |
| 92 |
using dependency information from the init.d script LSB comment header. |
| 93 |
This means that the init.d script will be disabled (see below). |
| 94 |
.sp |
| 95 |
If any files named |
| 96 |
\fB/etc/rc\fP\fIrunlevel\fP\fB\&.d/[SK]??\fP\fIname\fP |
| 97 |
already exist then |
| 98 |
\fBupdate\-rc.d\fP |
| 99 |
does nothing. |
| 100 |
The program was written this way so that it will never |
| 101 |
change an existing configuration, which may have been |
| 102 |
customized by the system administrator. |
| 103 |
The program will only install links if none are present, |
| 104 |
i.e., |
| 105 |
if it appears that the service has never been installed before. |
| 106 |
.sp |
| 107 |
Older versions of |
| 108 |
\fBupdate\-rc.d\fP |
| 109 |
also supported |
| 110 |
\fBstart\fP |
| 111 |
and |
| 112 |
\fBstop\fP |
| 113 |
options. These options are no longer supported, and are now |
| 114 |
equivalent to the |
| 115 |
\fBdefaults\fP |
| 116 |
option. |
| 117 |
.sp |
| 118 |
A common system administration error is to delete the links |
| 119 |
with the thought that this will \(dqdisable\(dq the service, i.e., |
| 120 |
that this will prevent the service from being started. |
| 121 |
However, if all links have been deleted then the next time |
| 122 |
the package is upgraded, the package\(aqs |
| 123 |
\fIpostinst\fP |
| 124 |
script will run |
| 125 |
\fBupdate\-rc.d\fP |
| 126 |
again and this will reinstall links at their factory default locations. |
| 127 |
The correct way to disable services is to configure the |
| 128 |
service as stopped in all runlevels in which it is started by default. |
| 129 |
In the System V init system this means renaming |
| 130 |
the service\(aqs symbolic links |
| 131 |
from \fBS\fP to \fBK\fP\&. |
| 132 |
\&.P |
| 133 |
The script |
| 134 |
\&.BI /etc/init.d/ name |
| 135 |
must exist before |
| 136 |
\fBupdate\-rc.d\fP |
| 137 |
is run to create the links. |
| 138 |
.SH REMOVING SCRIPTS |
| 139 |
.sp |
| 140 |
When invoked with the |
| 141 |
\fIremove\fP |
| 142 |
option, update\-rc.d removes any links in the |
| 143 |
\fB/etc/rc\fP\fIrunlevel\fP\fB\&.d\fP |
| 144 |
directories to the script |
| 145 |
\fB/etc/init.d/\fP\fIname\fP\&. |
| 146 |
The script must have been deleted already. |
| 147 |
If the script is still present then |
| 148 |
\fBupdate\-rc.d\fP |
| 149 |
aborts with an error message. |
| 150 |
\&.P |
| 151 |
\fBupdate\-rc.d\fP |
| 152 |
is usually called from a package\(aqs post\-removal script when that |
| 153 |
script is given the |
| 154 |
\fBpurge\fP |
| 155 |
argument. |
| 156 |
Any files in the |
| 157 |
\fB/etc/rc\fP\fIrunlevel\fP\fB\&.d\fP |
| 158 |
directories that are not symbolic links to the script |
| 159 |
\fB/etc/init.d/\fP\fIname\fP |
| 160 |
will be left untouched. |
| 161 |
.SH DISABLING INIT SCRIPT START LINKS |
| 162 |
.sp |
| 163 |
When run with the |
| 164 |
\fBdisable\fP [ \fIS|2|3|4|5\fP ] |
| 165 |
options, |
| 166 |
\fBupdate\-rc.d\fP |
| 167 |
modifies existing runlevel links for the script |
| 168 |
\fB/etc/init.d/\fP\fIname\fP |
| 169 |
by renaming start links to stop links with a sequence number equal |
| 170 |
to the difference of 100 minus the original sequence number. |
| 171 |
.sp |
| 172 |
When run with the |
| 173 |
\fBenable\fP [ \fIS|2|3|4|5\fP ] |
| 174 |
options, |
| 175 |
\fBupdate\-rc.d\fP |
| 176 |
modifies existing runlevel links for the script |
| 177 |
\fB/etc/init.d/\fP\fIname\fP |
| 178 |
by renaming stop links to start links with a sequence number equal |
| 179 |
to the positive difference of current sequence number minus 100, thus |
| 180 |
returning to the original sequence number that the script had been |
| 181 |
installed with before disabling it. |
| 182 |
\&.P |
| 183 |
Both of these options only operate on start runlevel links of S, 2, |
| 184 |
3, 4 or 5. If no start runlevel is specified after the disable or enable |
| 185 |
keywords, the script will attempt to modify links in all start runlevels. |
| 186 |
.SH OPTIONS |
| 187 |
.INDENT 0.0 |
| 188 |
.TP |
| 189 |
.B \-f |
| 190 |
Force removal of symlinks even if |
| 191 |
\fB/etc/init.d/\fP\fIname\fP |
| 192 |
still exists. |
| 193 |
.UNINDENT |
| 194 |
.SH EXAMPLES |
| 195 |
.sp |
| 196 |
Insert links using the defaults: |
| 197 |
.INDENT 0.0 |
| 198 |
.INDENT 3.5 |
| 199 |
\fBupdate\-rc.d foobar defaults\fP |
| 200 |
.UNINDENT |
| 201 |
.UNINDENT |
| 202 |
.sp |
| 203 |
The equivalent dependency header would have start and stop |
| 204 |
dependencies on $remote_fs and $syslog, and start in |
| 205 |
runlevels 2\-5 and stop in runlevels 0, 1 and 6. |
| 206 |
.sp |
| 207 |
Remove all links for a script (assuming foobar has been deleted |
| 208 |
already): |
| 209 |
.INDENT 0.0 |
| 210 |
.INDENT 3.5 |
| 211 |
\fBupdate\-rc.d foobar remove\fP |
| 212 |
.UNINDENT |
| 213 |
.UNINDENT |
| 214 |
.sp |
| 215 |
Example of disabling a service: |
| 216 |
.INDENT 0.0 |
| 217 |
.INDENT 3.5 |
| 218 |
\fBupdate\-rc.d foobar disable\fP |
| 219 |
.UNINDENT |
| 220 |
.UNINDENT |
| 221 |
.sp |
| 222 |
Example of a command for installing a system initialization\-and\-shutdown script: |
| 223 |
.INDENT 0.0 |
| 224 |
.INDENT 3.5 |
| 225 |
\fBupdate\-rc.d foobar defaults\fP |
| 226 |
.UNINDENT |
| 227 |
.UNINDENT |
| 228 |
.sp |
| 229 |
Example of a command for disabling a system initialization\-and\-shutdown script: |
| 230 |
.INDENT 0.0 |
| 231 |
.INDENT 3.5 |
| 232 |
\fBupdate\-rc.d foobar disable\fP |
| 233 |
.UNINDENT |
| 234 |
.UNINDENT |
| 235 |
.SH BUGS |
| 236 |
.sp |
| 237 |
See <http://bugs.debian.org/sysv\-rc> and |
| 238 |
<http://bugs.debian.org/init\-system\-helpers> \&. |
| 239 |
.SH FILES |
| 240 |
.INDENT 0.0 |
| 241 |
.TP |
| 242 |
.B \fB/etc/init.d/\fP |
| 243 |
The directory containing the actual init scripts. |
| 244 |
.TP |
| 245 |
.B \fB/etc/rc?.d/\fP |
| 246 |
The directories containing the links used by \fBinit\fP |
| 247 |
and managed by \fBupdate\-rc.d .\fP |
| 248 |
.TP |
| 249 |
.B \fB/etc/init.d/skeleton\fP |
| 250 |
Model for use by writers of \fBinit.d\fP scripts. |
| 251 |
.UNINDENT |
| 252 |
.SH SEE ALSO |
| 253 |
.nf |
| 254 |
\fIDebian Policy Manual\fP, |
| 255 |
\fB/etc/init.d/skeleton\fP, |
| 256 |
\fBinsserv\fP(8), |
| 257 |
\fBinit\fP(8) |
| 258 |
.fi |
| 259 |
.sp |
| 260 |
.SH AUTHOR |
| 261 |
Ian Jackson, |
| 262 |
Miquel van Smoorenburg |
| 263 |
|
| 264 |
License: GNU General Public License v2 or Later (GPLv2+) |
| 265 |
.SH COPYRIGHT |
| 266 |
2001 Henrique de Moraes Holschuh |
| 267 |
.\" Generated by docutils manpage writer. |
| 268 |
. |