~ubuntu-branches/ubuntu/karmic/sysvinit/karmic-updates

« back to all changes in this revision

Viewing changes to debian/sysv-rc/man8/update-rc.d.8

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2009-09-07 19:56:53 UTC
  • mfrom: (1.1.4 upstream) (2.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20090907195653-2i6t0j91wfbf1f0d
Tags: 2.87dsf-4ubuntu1
* Merge from debian unstable, remaining changes:
  - Support Cell processor:
    + debian/initscripts/postinst: Create spu system group and /spu mount
      point if we are running on a Cell processor.
    + debian/initscripts/etc/init.d/mountkernfs.sh: Mount spufs if Cell
      processor is detected.
    + debian/initscripts/lib/init/mount-functions.sh: Modprobe spufs
      if not available.
    + debian/control: Add initscripts dependency 'passwd' for groupadd.
    (Forwarded to Debian #483399)
  - Use tmpfs mounts for /var/lock and /var/run:
    + debian/initscripts/share/default.rcS: Enable RAMRUN and RAMLOCK by
      default.
    + debian/initscripts.postinst: Enable RAMRUN and RAMLOCK in
      /etc/default/rcS on upgrades. This needs to be kept until the next
      LTS.
    + debian/initscripts/etc/init.d/mountkernfs.sh: Propagate files from the
      initramfs to our new /var/run, so that we can populate
      /var/run/sendsigs.omit from initramfs.
  - Boot ordering differences:
    + mountkernfs.sh: 02 -> 01
    + mountdevsubfs.sh: 04 -> 11
    + bootlogd: disabled by default
    + checkroot.sh: 10 -> 20
    + mtab.sh: 12 -> 22
  - debian/patches/91_sulogin_lockedpw.dpatch: Disable "root account is
    locked" warning, since this is the default in Ubuntu. Document this in
    sulogin.8.
  - debian/control: Drop Essential: yes from packages since we use Upstart.
  - debian/control: Conflict/Replace sysvconfig which has also previously
    provided service(8).
  - debian/control, debian/rules: Previous name for sysvinit-utils was
    'sysvutils' in Ubuntu, so Conflict/Replace/Provide it. Also create a
    dummy sysvutils package, since Hardy has reverse versioned dependencies
    to it. This needs to be kept until after the next LTS.
  - debian/control: Depend on lsb-base (>= 3.2-14) for status_of_proc()
    function.
  - debian/initscripts/etc/init.d/checkfs.sh: Don't depend on hwclockfirst
    which Ubuntu does not have.
  - debian/initscripts/etc/init.d/mountkernfs.sh: Always mount devpts, and
    do not touch /dev/ptmx (which is already managed by udev).
  - debian/initscripts/etc/init.d/mountkernfs.sh: mount fusectl if it is
    available
  - debian/initscripts/etc/init.d/mountkernfs.sh: mount securityfs if it is
    available. This allows for easier AppArmor confinement of applications
    early in the boot process. LP: #399954
  - debian/initscripts/etc/init.d/mountkernfs.sh: mount debugfs if it is
    available.
  - debian/initscripts/etc/init.d/ondemand: Sleep for 60 seconds, then
    set CPU Frequency Scaling governor to "ondemand".   LP: #341573.
  - debian/initscripts/etc/init.d/umountfs: Don't unmount filesystems
    that precede root or use force for some mountpoints.
  - debian/initscripts/etc/network/if-up.d/mountnfs: Rename ifstate
    file to /var/run/network/ifstate
  - ./debian/initscripts/lib/init/usplash-fsck-functions.sh: Use blkid,
    vol_id is gone.
  - debian/initscripts.{pre,postinst}: waitnfs.sh -> mountnfs.sh renaming
    transition. This needs to be kept until after the next LTS.

LP: #32455, #94120, #160197, #382097 (amongst others).

* debian/sysv-rc/sbin/update-rc.d: Dropped support for "multiuser"
  command-line option.
* debian/rules: Compat symlink from /usr/bin/service to /usr/sbin/service
* debian/initscripts.postinst: Transition from bootlogs.sh to bootlogs

* debian/sysv-rc.postinst: Don't try and use insserv by default, though
  everything's in place for you to try if you like.  It can be activated
  with:
      USEINSSERV=yes dpkg-reconfigure sysv-rc

Show diffs side-by-side

added added

removed removed

Lines of Context:
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"
4
 
.SH NAME
5
 
update\-rc.d \- install and remove System-V style init script links
6
 
.SH SYNOPSIS
 
3
.TH "UPDATE\-RC.D" "8" "14 November 2005" "Debian Project" "sysv-rc"
 
4
.SH "NAME"
 
5
update\-rc.d \- install and remove System\-V style init script links
 
6
.SH "SYNOPSIS"
7
7
.B update\-rc.d
8
 
.RI [ -n ]
9
 
.RI [ -f ]
10
 
.IB name " remove"
 
8
.RI [ \-n ]
 
9
.RI [ \-f ]
 
10
.I B name " remove"
11
11
.HP
12
 
.B update-rc.d
13
 
.RI [ -n ]
14
 
.IB name " defaults"
 
12
.B update\-rc.d
 
13
.RI [ \-n ]
 
14
.I B name " defaults"
15
15
.RI [ NN " | " SS " " KK ]
16
16
.HP
17
 
.B update-rc.d
18
 
.RI [ -n ]
 
17
.B update\-rc.d
 
18
.RI [ \-n ]
19
19
.I name
20
20
.BR start | stop
21
 
.IR "NN runlevel" " [" runlevel "]..."
 
21
.I R "NN runlevel" " [" runlevel "]..."
22
22
.B .
23
23
.BR start | stop
24
 
.IR "NN runlevel" " [" runlevel "]..."
 
24
.I R "NN runlevel" " [" runlevel "]..."
25
25
.BR . " ..."
26
 
.SH DESCRIPTION
27
 
.B update-rc.d
 
26
.HP
 
27
.B update\-rc.d
 
28
.RI [ \-n ]
 
29
.I B name " disable|enable "
 
30
.RI [ " S|2|3|4|5 " ]
 
31
.SH "DESCRIPTION"
 
32
.B update\-rc.d
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 "
39
44
.I NN
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
41
46
.B init
42
47
will run the scripts.
43
48
 
44
49
This manpage documents only the usage and behaviour of
45
 
.BR update-rc.d .
 
50
.BR update\-rc.d .
46
51
For a discussion of the System V style init script arrangements please
47
52
see
48
53
.BR init (8)
49
54
and the
50
 
.IR "Debian Policy Manual" .
51
 
.P
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
56
 
.BR update-rc.d
57
 
to manage runlevels.
58
 
They should edit the links directly or
59
 
use runlevel editors such as
60
 
.B sysv-rc-conf
61
 
and
62
 
.B bum
63
 
instead.
64
 
.SH INSTALLING INIT SCRIPT LINKS
 
55
.I R "Debian Policy Manual" .
 
56
 
 
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 .
 
73
 
 
74
Packages installing init.d scripts should make sure both methods work,
 
75
for compatiblity with systems where the migration have not been done
 
76
yet.
 
77
 
 
78
For legacy mode, the following section documents the old behaviour.
 
79
 
65
80
When run with either the
66
81
.BR defaults ", " start ", or " stop
67
82
options,
68
 
.B update-rc.d
 
83
.B update\-rc.d
69
84
makes links
70
85
.BI /etc/rc runlevel .d/[SK] NNname
71
86
that point to the script
74
89
If any files
75
90
.BI /etc/rc runlevel .d/[SK]?? name
76
91
already exist then
77
 
.B update-rc.d
 
92
.B update\-rc.d
78
93
does nothing.
79
94
The program was written this way so that it will never
80
95
change an existing configuration, which may have been
90
105
the package is upgraded, the package's
91
106
.I postinst
92
107
script will run
93
 
.B update-rc.d
 
108
.B update\-rc.d
94
109
again and this will reinstall links at their factory default locations.
95
110
The correct way to disable services is to configure the
96
111
service as stopped in all runlevels in which it is started by default.
104
119
If
105
120
.B defaults
106
121
is used then
107
 
.B update-rc.d
 
122
.B update\-rc.d
108
123
will make links to start the service in runlevels
109
124
.B 2345
110
125
and to stop the service in runlevels
127
142
compatibility but is discouraged, as it may lead to inconsistent
128
143
settings. As a rule of thumb, if you increase the start sequence
129
144
number you should also decrease the stop sequence number, and
130
 
vice-versa.
 
145
vice\-versa.
131
146
.P
132
147
As a rule of thumb, the sequence number of the stop link 
133
148
should be 100 minus the sequence number of the start link;
136
151
Obviously, therefore, the default stop sequence number
137
152
should be 80.
138
153
Defaulting to 20, as
139
 
.B update-rc.d
 
154
.B update\-rc.d
140
155
does, is an old bug that cannot be fixed because
141
156
of the risk of breaking things.
142
157
.P
147
162
Each of these sets of arguments starts with the keyword
148
163
.BR start " or " stop
149
164
and a sequence number
150
 
.IR NN ,
 
165
.I R NN ,
151
166
followed by one or more runlevel numbers.
152
167
The set is terminated by a solitary full stop character.
153
168
When explicit specification, rather than
173
188
The script
174
189
.BI /etc/init.d/ name
175
190
must exist before
176
 
.B update-rc.d
 
191
.B update\-rc.d
177
192
is run to create the links.
178
 
.SH REMOVING SCRIPTS
 
193
.SH "REMOVING SCRIPTS"
179
194
When invoked with the
180
195
.I remove
181
 
option, update-rc.d removes any links in the
 
196
option, update\-rc.d removes any links in the
182
197
.BI /etc/rc runlevel .d
183
198
directories to the script
184
199
.BI /etc/init.d/ name\fR.
185
200
The script must have been deleted already.
186
201
If the script is still present then
187
 
.B update-rc.d
 
202
.B update\-rc.d
188
203
aborts with an error message.
189
204
.P
190
 
.B update-rc.d
191
 
is usually called from a package's post-removal script when that
 
205
.B update\-rc.d
 
206
is usually called from a package's post\-removal script when that
192
207
script is given the
193
208
.B purge
194
209
argument.
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"
 
216
When run with the
 
217
.BR disable " [ " S|2|3|4|5 " ] "
 
218
options,
 
219
.B update\-rc.d
 
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.
 
224
.P
 
225
When run with the
 
226
.BR enable " [ " S|2|3|4|5 " ] "
 
227
options,
 
228
.B update\-rc.d
 
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.
 
235
.P
 
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.
200
239
 
201
 
.SH OPTIONS
202
 
.TP
203
 
.I -n
 
240
.SH "OPTIONS"
 
241
.TP 
 
242
.I \-n
204
243
Don't do anything, just show what we would do.
205
 
.TP
206
 
.I -f
 
244
.TP 
 
245
.I \-f
207
246
Force removal of symlinks even if
208
247
.BI /etc/init.d/ name
209
248
still exists.
210
 
.SH EXAMPLES
 
249
.SH "EXAMPLES"
211
250
Insert links using the defaults:
212
 
.nf
213
 
.B "   update-rc.d foobar defaults"
214
 
.fi
 
251
.nf 
 
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.
 
256
.fi 
215
257
Equivalent command using explicit argument sets:
216
 
.nf
217
 
.B "   update-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 ."
218
 
.fi
 
258
.nf 
 
259
.B "   update\-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 ."
 
260
.fi 
219
261
More typical command using explicit argument sets:
220
 
.nf
221
 
.B "   update-rc.d foobar start 30 2 3 4 5 . stop 70 0 1 6 ."
222
 
.fi
 
262
.nf 
 
263
.B "   update\-rc.d foobar start 30 2 3 4 5 . stop 70 0 1 6 ."
 
264
.fi 
223
265
Insert links at default runlevels when B requires A
224
 
.nf
225
 
.B "   update-rc.d script_for_A defaults 80 20"
226
 
.B "   update-rc.d script_for_B defaults 90 10"
227
 
.fi
 
266
.nf 
 
267
.B "   update\-rc.d script_for_A defaults 80 20"
 
268
.B "   update\-rc.d script_for_B defaults 90 10"
 
269
.fi 
228
270
Insert a link to a service that (presumably) will not be
229
271
needed by any other daemon
230
 
.nf
231
 
.B "   update-rc.d top_level_app defaults 98 02"
232
 
.fi
 
272
.nf 
 
273
.B "   update\-rc.d top_level_app defaults 98 02"
 
274
.fi 
233
275
Insert links for a script that requires services that
234
276
start/stop at sequence number 20
235
 
.nf
236
 
.B "   update-rc.d script_depends_on_svc20 defaults 21 19"
237
 
.fi
 
277
.nf 
 
278
.B "   update\-rc.d script_depends_on_svc20 defaults 21 19"
 
279
.fi 
238
280
Remove all links for a script (assuming foobar has been deleted
239
281
already):
240
 
.nf
241
 
.B "   update-rc.d foobar remove"
242
 
.fi
 
282
.nf 
 
283
.B "   update\-rc.d foobar remove"
 
284
.fi 
243
285
Example of disabling a service:
244
 
.nf
245
 
.B "   update-rc.d -f foobar remove"
246
 
.B "   update-rc.d foobar stop 20 2 3 4 5 ."
247
 
.fi
248
 
Example of a command for installing a system initialization-and-shutdown script:
249
 
.nf
250
 
.B "   update-rc.d foobar start 45 S . stop 31 0 6 ."
251
 
.fi
252
 
Example of a command for disabling a system initialization-and-shutdown script:
253
 
.nf
254
 
.B "   update-rc.d -f foobar remove"
255
 
.B "   update-rc.d foobar stop 45 S ."
256
 
.fi
 
286
.nf 
 
287
.B "   update\-rc.d \-f foobar remove"
 
288
.B "   update\-rc.d foobar stop 20 2 3 4 5 ."
 
289
.fi 
 
290
Example of a command for installing a system initialization\-and\-shutdown script:
 
291
.nf 
 
292
.B "   update\-rc.d foobar start 45 S . stop 31 0 6 ."
 
293
.fi 
 
294
Example of a command for disabling a system initialization\-and\-shutdown script:
 
295
.nf 
 
296
.B "   update\-rc.d \-f foobar remove"
 
297
.B "   update\-rc.d foobar stop 45 S ."
 
298
.fi 
257
299
 
258
 
.SH BUGS
259
 
See http://bugs.debian.org/sysv-rc.
260
 
.SH FILES
261
 
.TP
 
300
.SH "BUGS"
 
301
See http://bugs.debian.org/sysv\-rc.
 
302
.SH "FILES"
 
303
.TP 
262
304
.B /etc/init.d/
263
305
The directory containing the actual init scripts.
264
 
.TP
 
306
.TP 
265
307
.B /etc/rc?.d/
266
308
The directories containing the links used by
267
309
.BR init
268
310
and managed by
269
 
.BR update-rc.d .
270
 
.TP
 
311
.BR update\-rc.d .
 
312
.TP 
271
313
.B /etc/init.d/skeleton
272
314
Model for use by writers of
273
315
.B init.d
274
316
scripts.
275
 
.SH SEE ALSO
276
 
.IR "Debian Policy Manual" ,
277
 
.br
 
317
.TP 
 
318
.B /var/lib/sysv\-rc/legacy\-bootsequence
 
319
Flag indicating the machine is using legacy mode for boot script
 
320
ordering.
 
321
.SH "SEE ALSO"
 
322
.I R "Debian Policy Manual" ,
 
323
.br 
278
324
.BR /etc/init.d/skeleton ,
279
 
.br
280
 
.BR sysv-rc-conf (8),
 
325
.br 
 
326
.BR insserv (8),
 
327
.BR sysv\-rc\-conf (8),
281
328
.BR bum (8),
282
329
.BR init (8).