1
1
.\" Hey, Emacs! This is an -*- nroff -*- source file.
2
2
.\" Authors: Ian Jackson, Miquel van Smoorenburg
3
.TH UPDATE\-RC.D 8 "14 November 2005" "Debian Project" "sysv-rc"
5
update\-rc.d \- install and remove System-V style init script links
3
.TH "UPDATE\-RC.D" "8" "14 November 2005" "Debian Project" "sysv-rc"
5
update\-rc.d \- install and remove System\-V style init script links
15
15
.RI [ NN " | " SS " " KK ]
21
.IR "NN runlevel" " [" runlevel "]..."
21
.I R "NN runlevel" " [" runlevel "]..."
24
.IR "NN runlevel" " [" runlevel "]..."
24
.I R "NN runlevel" " [" runlevel "]..."
29
.I B name " disable|enable "
28
33
updates the System V style init script links
29
34
.BI /etc/rc runlevel .d/ NNname
30
35
whose target is the script
37
42
is one of the runlevels supported by
38
43
.BR init ", namely, " 0123456789S ", and "
40
is the two-digit sequence number that determines where in the sequence
45
is the two\-digit sequence number that determines where in the sequence
42
47
will run the scripts.
44
49
This manpage documents only the usage and behaviour of
46
51
For a discussion of the System V style init script arrangements please
50
.IR "Debian Policy Manual" .
52
Please note that this program was designed for use
53
in package maintainer scripts and, accordingly,
54
has only the very limited functionality required by such scripts.
55
System administrators are not encouraged to use
58
They should edit the links directly or
59
use runlevel editors such as
64
.SH INSTALLING INIT SCRIPT LINKS
55
.I R "Debian Policy Manual" .
57
.SH "INSTALLING INIT SCRIPT LINKS"
58
update\-rc.d has two modes of operation for installing scripts
59
into the boot sequence. A legacy mode where command line arguments
60
are used to decide the sequence and runlevel configuration,
61
and the default mode where dependency and runlevel information in
62
the init.d script LSB comment header is used instead. Such
63
header is required to be present in init.d scripts.
64
See the insserv(8) manual page for details about the LSB
65
header format. The boot sequencing method is decided
66
during installation or upgrades. During upgrades, if there
67
are no loops in the dependencies declared by LSB headers of all
68
installed init.d scripts and no obsolete init.d scripts,
69
the boot system is converted to dependency based boot sequencing.
70
The conversion to dependency based boot sequencing is one\-way. The
71
machines using the legacy mode will have a file
72
/etc/init.d/.legacy\-bootordering .
74
Packages installing init.d scripts should make sure both methods work,
75
for compatiblity with systems where the migration have not been done
78
For legacy mode, the following section documents the old behaviour.
65
80
When run with either the
66
81
.BR defaults ", " start ", or " stop
70
85
.BI /etc/rc runlevel .d/[SK] NNname
71
86
that point to the script
197
212
directories that are not symbolic links to the script
198
213
.BI /etc/init.d/ name
199
214
will be left untouched.
215
.SH "DISABLING INIT SCRIPT START LINKS"
217
.BR disable " [ " S|2|3|4|5 " ] "
220
modifies existing runlevel links for the script
221
.BR /etc/init.d/ \fIname\fR
222
by renaming start links to stop links with a sequence number equal
223
to the difference of 100 minus the original sequence number.
226
.BR enable " [ " S|2|3|4|5 " ] "
229
modifies existing runlevel links for the script
230
.BR /etc/init.d/ \fIname\fR
231
by renaming stop links to start links with a sequence number equal
232
to the positive difference of current sequence number minus 100, thus
233
returning to the original sequence number that the script had been
234
installed with before disabling it.
236
Both of these options only operate on start runlevel links of S, 2,
237
3, 4 or 5. If no start runlevel is specified after the disable or enable
238
keywords, the script will attempt to modify links in all start runlevels.
204
243
Don't do anything, just show what we would do.
207
246
Force removal of symlinks even if
208
247
.BI /etc/init.d/ name
211
250
Insert links using the defaults:
213
.B " update-rc.d foobar defaults"
252
.B " update\-rc.d foobar defaults"
253
The equivalent dependency header would have start and stop
254
dependencies on $remote_fs and $syslog, and start in
255
runlevels 2\-5 and stop in runlevels 0, 1 and 6.
215
257
Equivalent command using explicit argument sets:
217
.B " update-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 ."
259
.B " update\-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 ."
219
261
More typical command using explicit argument sets:
221
.B " update-rc.d foobar start 30 2 3 4 5 . stop 70 0 1 6 ."
263
.B " update\-rc.d foobar start 30 2 3 4 5 . stop 70 0 1 6 ."
223
265
Insert links at default runlevels when B requires A
225
.B " update-rc.d script_for_A defaults 80 20"
226
.B " update-rc.d script_for_B defaults 90 10"
267
.B " update\-rc.d script_for_A defaults 80 20"
268
.B " update\-rc.d script_for_B defaults 90 10"
228
270
Insert a link to a service that (presumably) will not be
229
271
needed by any other daemon
231
.B " update-rc.d top_level_app defaults 98 02"
273
.B " update\-rc.d top_level_app defaults 98 02"
233
275
Insert links for a script that requires services that
234
276
start/stop at sequence number 20
236
.B " update-rc.d script_depends_on_svc20 defaults 21 19"
278
.B " update\-rc.d script_depends_on_svc20 defaults 21 19"
238
280
Remove all links for a script (assuming foobar has been deleted
241
.B " update-rc.d foobar remove"
283
.B " update\-rc.d foobar remove"
243
285
Example of disabling a service:
245
.B " update-rc.d -f foobar remove"
246
.B " update-rc.d foobar stop 20 2 3 4 5 ."
248
Example of a command for installing a system initialization-and-shutdown script:
250
.B " update-rc.d foobar start 45 S . stop 31 0 6 ."
252
Example of a command for disabling a system initialization-and-shutdown script:
254
.B " update-rc.d -f foobar remove"
255
.B " update-rc.d foobar stop 45 S ."
287
.B " update\-rc.d \-f foobar remove"
288
.B " update\-rc.d foobar stop 20 2 3 4 5 ."
290
Example of a command for installing a system initialization\-and\-shutdown script:
292
.B " update\-rc.d foobar start 45 S . stop 31 0 6 ."
294
Example of a command for disabling a system initialization\-and\-shutdown script:
296
.B " update\-rc.d \-f foobar remove"
297
.B " update\-rc.d foobar stop 45 S ."
259
See http://bugs.debian.org/sysv-rc.
301
See http://bugs.debian.org/sysv\-rc.
263
305
The directory containing the actual init scripts.
266
308
The directories containing the links used by
271
313
.B /etc/init.d/skeleton
272
314
Model for use by writers of
276
.IR "Debian Policy Manual" ,
318
.B /var/lib/sysv\-rc/legacy\-bootsequence
319
Flag indicating the machine is using legacy mode for boot script
322
.I R "Debian Policy Manual" ,
278
324
.BR /etc/init.d/skeleton ,
280
.BR sysv-rc-conf (8),
327
.BR sysv\-rc\-conf (8),