~oem-solutions-releng/live-build/lb-sg-2.x-add-support-for-xz-and-bzip2-compression

« back to all changes in this revision

Viewing changes to includes/etch/install/doc/FAQ/html/ch-customizing.en.html

  • Committer: Daniel Baumann
  • Date: 2011-03-09 17:19:41 UTC
  • Revision ID: daniel@debian.org-20110309171941-vyn0zxupujidmbu9
Adding live-helper 1.0~a15-1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2
 
 
3
 
<html>
4
 
 
5
 
<head>
6
 
 
7
 
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
8
 
 
9
 
<title>The Debian GNU/Linux FAQ - Customizing your installation of Debian GNU/Linux</title>
10
 
 
11
 
</head>
12
 
 
13
 
<body>
14
 
 
15
 
<p><a name="ch-customizing"></a></p>
16
 
<hr>
17
 
 
18
 
<p>
19
 
[ <a href="ch-kernel.en.html">previous</a> ]
20
 
[ <a href="index.en.html#contents">Contents</a> ]
21
 
[ <a href="ch-basic_defs.en.html">1</a> ]
22
 
[ <a href="ch-getting.en.html">2</a> ]
23
 
[ <a href="ch-compat.en.html">3</a> ]
24
 
[ <a href="ch-software.en.html">4</a> ]
25
 
[ <a href="ch-ftparchives.en.html">5</a> ]
26
 
[ <a href="ch-pkg_basics.en.html">6</a> ]
27
 
[ <a href="ch-pkgtools.en.html">7</a> ]
28
 
[ <a href="ch-uptodate.en.html">8</a> ]
29
 
[ <a href="ch-kernel.en.html">9</a> ]
30
 
[ 10 ]
31
 
[ <a href="ch-support.en.html">11</a> ]
32
 
[ <a href="ch-contributing.en.html">12</a> ]
33
 
[ <a href="ch-redistrib.en.html">13</a> ]
34
 
[ <a href="ch-nexttime.en.html">14</a> ]
35
 
[ <a href="ch-faqinfo.en.html">15</a> ]
36
 
[ <a href="ch-support.en.html">next</a> ]
37
 
</p>
38
 
 
39
 
<hr>
40
 
 
41
 
<h1>
42
 
The Debian GNU/Linux FAQ
43
 
<br>Chapter 10 - Customizing your installation of Debian GNU/Linux
44
 
</h1>
45
 
 
46
 
<hr>
47
 
 
48
 
<h2><a name="s-papersize"></a>10.1 How can I ensure that all programs use the same paper size?</h2>
49
 
 
50
 
<p>
51
 
Install the <code>libpaper1</code> package, and it will ask you for a
52
 
system-wide default paper size.  This setting will be kept in the file
53
 
<samp>/etc/papersize</samp>.
54
 
</p>
55
 
 
56
 
<p>
57
 
Users can override the paper size setting using the <samp>PAPERSIZE</samp>
58
 
environment variable.  For details, see the manual page
59
 
<code>papersize(5)</code>.
60
 
</p>
61
 
 
62
 
<hr>
63
 
 
64
 
<h2><a name="s-hardwareaccess"></a>10.2 How can I provide access to hardware peripherals, without compromising security?</h2>
65
 
 
66
 
<p>
67
 
Many device files in the <samp>/dev</samp> directory belong to some predefined
68
 
groups.  For example, <samp>/dev/fd0</samp> belongs to the <samp>floppy</samp>
69
 
group, and <samp>/dev/dsp</samp> belongs to the <samp>audio</samp> group.
70
 
</p>
71
 
 
72
 
<p>
73
 
If you want a certain user to have access to one of these devices, just add the
74
 
user to the group the device belongs to, i.e.  do:
75
 
</p>
76
 
 
77
 
<pre>
78
 
     adduser user group
79
 
</pre>
80
 
 
81
 
<p>
82
 
This way you won't have to change the file permissions on the device.
83
 
</p>
84
 
 
85
 
<hr>
86
 
 
87
 
<h2><a name="s-consolefont"></a>10.3 How do I load a console font on startup the Debian way?</h2>
88
 
 
89
 
<p>
90
 
The <code>kbd</code> and <code>console-tools</code> packages support this, edit
91
 
<samp>/etc/kbd/config</samp> or <samp>/etc/console-tools/config</samp> files.
92
 
</p>
93
 
 
94
 
<hr>
95
 
 
96
 
<h2><a name="s-appdefaults"></a>10.4 How can I configure an X11 program's application defaults?</h2>
97
 
 
98
 
<p>
99
 
Debian's X programs will install their application resource data in the
100
 
<samp>/etc/X11/app-defaults/</samp> directory.  If you want to customize X
101
 
applications globally, put your customizations in those files.  They are marked
102
 
as configuration files, so their contents will be preserved during upgrades.
103
 
</p>
104
 
 
105
 
<hr>
106
 
 
107
 
<h2><a name="s-booting"></a>10.5 Every distribution seems to have a different boot-up method. Tell me about Debian's.</h2>
108
 
 
109
 
<p>
110
 
Like all Unices, Debian boots up by executing the program <samp>init</samp>.
111
 
The configuration file for <samp>init</samp> (which is
112
 
<samp>/etc/inittab</samp>) specifies that the first script to be executed
113
 
should be <samp>/etc/init.d/rcS</samp>.  This script runs all of the scripts in
114
 
<samp>/etc/rcS.d/</samp> by sourcing or forking subprocess depending on their
115
 
file extension to perform initialization such as to check and to mount file
116
 
systems, to load modules, to start the network services, to set the clock, and
117
 
to perform other initialization.  Then, for compatibility, it runs the files
118
 
(except those with a `.'in the filename) in <samp>/etc/rc.boot/</samp> too.
119
 
Any scripts in the latter directory are usually reserved for system
120
 
administrator use, and using them in packages is deprecated.
121
 
</p>
122
 
 
123
 
<p>
124
 
After completing the boot process, <samp>init</samp> executes all start scripts
125
 
in a directory specified by the default runlevel (this runlevel is given by the
126
 
entry for <samp>id</samp> in <samp>/etc/inittab</samp>).  Like most System V
127
 
compatible Unices, Linux has 7 runlevels:
128
 
</p>
129
 
<ul>
130
 
<li>
131
 
<p>
132
 
0 (halt the system),
133
 
</p>
134
 
</li>
135
 
</ul>
136
 
<ul>
137
 
<li>
138
 
<p>
139
 
1 (single-user mode),
140
 
</p>
141
 
</li>
142
 
</ul>
143
 
<ul>
144
 
<li>
145
 
<p>
146
 
2 through 5 (various multi-user modes), and
147
 
</p>
148
 
</li>
149
 
</ul>
150
 
<ul>
151
 
<li>
152
 
<p>
153
 
6 (reboot the system).
154
 
</p>
155
 
</li>
156
 
</ul>
157
 
 
158
 
<p>
159
 
Debian systems come with id=2, which indicates that the default runlevel will
160
 
be '2' when the multi-user state is entered, and the scripts in
161
 
<samp>/etc/rc2.d/</samp> will be run.
162
 
</p>
163
 
 
164
 
<p>
165
 
In fact, the scripts in any of the directories, <samp>/etc/rcN.d/</samp> are
166
 
just symbolic links back to scripts in <samp>/etc/init.d/</samp>.  However, the
167
 
<em>names</em> of the files in each of the <samp>/etc/rcN.d/</samp> directories
168
 
are selected to indicate the <em>way</em> the scripts in
169
 
<samp>/etc/init.d/</samp> will be run.  Specifically, before entering any
170
 
runlevel, all the scripts beginning with 'K' are run; these scripts kill
171
 
services.  Then all the scripts beginning with 'S' are run; these scripts start
172
 
services.  The two-digit number following the 'K' or 'S' indicates the order in
173
 
which the script is run.  Lower numbered scripts are executed first.
174
 
</p>
175
 
 
176
 
<p>
177
 
This approach works because the scripts in <samp>/etc/init.d/</samp> all take
178
 
an argument which can be either `start', `stop', `reload', `restart' or
179
 
`force-reload' and will then do the task indicated by the argument.  These
180
 
scripts can be used even after a system has been booted, to control various
181
 
processes.
182
 
</p>
183
 
 
184
 
<p>
185
 
For example, with the argument `reload' the command
186
 
</p>
187
 
 
188
 
<pre>
189
 
     /etc/init.d/sendmail reload
190
 
</pre>
191
 
 
192
 
<p>
193
 
sends the sendmail daemon a signal to reread its configuration file.  (BTW,
194
 
Debian supplies <code>invoke-rc.d</code> as a wrapper for invoking the scripts
195
 
in <samp>/etc/init.d/</samp>.)
196
 
</p>
197
 
 
198
 
<hr>
199
 
 
200
 
<h2><a name="s-custombootscripts"></a>10.6 It looks as if Debian does not use <samp>rc.local</samp> to customize the boot process; what facilities are provided?</h2>
201
 
 
202
 
<p>
203
 
Suppose a system needs to execute script <samp>foo</samp> on start-up, or on
204
 
entry to a particular (System V) runlevel.  Then the system administrator
205
 
should:
206
 
</p>
207
 
<ul>
208
 
<li>
209
 
<p>
210
 
Enter the script <samp>foo</samp> into the directory <samp>/etc/init.d/</samp>.
211
 
</p>
212
 
</li>
213
 
</ul>
214
 
<ul>
215
 
<li>
216
 
<p>
217
 
Run the Debian command <samp>update-rc.d</samp> with appropriate arguments, to
218
 
set up links between the (command-line-specified) directories rc?.d and
219
 
<samp>/etc/init.d/foo</samp>.  Here, '?'  is a number from 0 through 6 and
220
 
corresponds to each of the System V runlevels.
221
 
</p>
222
 
</li>
223
 
</ul>
224
 
<ul>
225
 
<li>
226
 
<p>
227
 
Reboot the system.
228
 
</p>
229
 
</li>
230
 
</ul>
231
 
 
232
 
<p>
233
 
The command <samp>update-rc.d</samp> will set up links between files in the
234
 
directories rc?.d and the script in <samp>/etc/init.d/</samp>.  Each link will
235
 
begin with a 'S' or a 'K', followed by a number, followed by the name of the
236
 
script.  Scripts beginning with 'S' in <samp>/etc/rcN.d/</samp> are executed
237
 
when runlevel <samp>N</samp> is entered.  Scripts beginning with a 'K' are
238
 
executed when leaving runlevel <samp>N</samp>.
239
 
</p>
240
 
 
241
 
<p>
242
 
One might, for example, cause the script <samp>foo</samp> to execute at
243
 
boot-up, by putting it in <samp>/etc/init.d/</samp> and installing the links
244
 
with <samp>update-rc.d foo defaults 19</samp>.  The argument 'defaults' refers
245
 
to the default runlevels, which are 2 through 5.  The argument '19' ensures
246
 
that <samp>foo</samp> is called before any scripts containing numbers 20 or
247
 
larger.
248
 
</p>
249
 
 
250
 
<hr>
251
 
 
252
 
<h2><a name="s-interconffiles"></a>10.7 How does the package management system deal with packages that contain configuration files for other packages?</h2>
253
 
 
254
 
<p>
255
 
Some users wish to create, for example, a new server by installing a group of
256
 
Debian packages and a locally generated package consisting of configuration
257
 
files.  This is not generally a good idea, because <code>dpkg</code> will not
258
 
know about those configuration files if they are in a different package, and
259
 
may write conflicting configurations when one of the initial &quot;group&quot;
260
 
of packages is upgraded.
261
 
</p>
262
 
 
263
 
<p>
264
 
Instead, create a local package that modifies the configuration files of the
265
 
&quot;group&quot; of Debian packages of interest.  Then <code>dpkg</code> and
266
 
the rest of the package management system will see that the files have been
267
 
modified by the local &quot;sysadmin&quot; and will not try to overwrite them
268
 
when those packages are upgraded.
269
 
</p>
270
 
 
271
 
<hr>
272
 
 
273
 
<h2><a name="s-divert"></a>10.8 How do I override a file installed by a package, so that a different version can be used instead?</h2>
274
 
 
275
 
<p>
276
 
Suppose a sysadmin or local user wishes to use a program
277
 
&quot;login-local&quot; rather than the program &quot;login&quot; provided by
278
 
the Debian <code>login</code> package.
279
 
</p>
280
 
 
281
 
<p>
282
 
Do <strong>not</strong>:
283
 
</p>
284
 
<ul>
285
 
<li>
286
 
<p>
287
 
Overwrite <samp>/bin/login</samp> with <samp>login-local</samp>.
288
 
</p>
289
 
</li>
290
 
</ul>
291
 
 
292
 
<p>
293
 
The package management system will not know about this change, and will simply
294
 
overwrite your custom <samp>/bin/login</samp> whenever <samp>login</samp> (or
295
 
any package that provides <samp>/bin/login</samp>) is installed or updated.
296
 
</p>
297
 
 
298
 
<p>
299
 
Rather, do
300
 
</p>
301
 
<ul>
302
 
<li>
303
 
<p>
304
 
Execute:
305
 
</p>
306
 
 
307
 
<pre>
308
 
     dpkg-divert --divert /bin/login.debian /bin/login
309
 
</pre>
310
 
 
311
 
<p>
312
 
in order to cause all future installations of the Debian <code>login</code>
313
 
package to write the file <samp>/bin/login</samp> to
314
 
<samp>/bin/login.debian</samp> instead.
315
 
</p>
316
 
</li>
317
 
</ul>
318
 
<ul>
319
 
<li>
320
 
<p>
321
 
Then execute:
322
 
</p>
323
 
 
324
 
<pre>
325
 
     cp login-local /bin/login
326
 
</pre>
327
 
 
328
 
<p>
329
 
to move your own locally-built program into place.
330
 
</p>
331
 
</li>
332
 
</ul>
333
 
 
334
 
<p>
335
 
Details are given in the manual page <code>dpkg-divert(8)</code>.
336
 
</p>
337
 
 
338
 
<hr>
339
 
 
340
 
<h2><a name="s-localpackages"></a>10.9 How can I have my locally-built package included in the list of available packages that the package management system knows about?</h2>
341
 
 
342
 
<p>
343
 
Execute the command:
344
 
</p>
345
 
 
346
 
<pre>
347
 
     dpkg-scanpackages BIN_DIR OVERRIDE_FILE [PATHPREFIX] &gt; my_Packages
348
 
</pre>
349
 
 
350
 
<p>
351
 
where:
352
 
</p>
353
 
<ul>
354
 
<li>
355
 
<p>
356
 
BIN-DIR is a directory where Debian archive files (which usually have an
357
 
extension of &quot;.deb&quot;) are stored.
358
 
</p>
359
 
</li>
360
 
</ul>
361
 
<ul>
362
 
<li>
363
 
<p>
364
 
OVERRIDE_FILE is a file that is edited by the distribution maintainers and is
365
 
usually stored on a Debian FTP archive at <samp>indices/override.main.gz</samp>
366
 
for the Debian packages in the &quot;main&quot; distribution.  You can ignore
367
 
this for local packages.
368
 
</p>
369
 
</li>
370
 
</ul>
371
 
<ul>
372
 
<li>
373
 
<p>
374
 
PATHPREFIX is an <em>optional</em> string that can be prepended to the
375
 
<samp>my_Packages</samp> file being produced.
376
 
</p>
377
 
</li>
378
 
</ul>
379
 
 
380
 
<p>
381
 
Once you have built the file <samp>my_Packages</samp>, tell the package
382
 
management system about it by using the command:
383
 
</p>
384
 
 
385
 
<pre>
386
 
     dpkg --merge-avail my_Packages
387
 
</pre>
388
 
 
389
 
<p>
390
 
If you are using APT, you can add the local repository to your
391
 
<code>sources.list(5)</code> file, too.
392
 
</p>
393
 
 
394
 
<hr>
395
 
 
396
 
<h2><a name="s-diverse"></a>10.10 Some users like mawk, others like gawk; some like vim, others like elvis; some like trn, others like tin; how does Debian support diversity?</h2>
397
 
 
398
 
<p>
399
 
There are several cases where two packages provide two different versions of a
400
 
program, both of which provide the same core functionality.  Users might prefer
401
 
one over another out of habit, or because the user interface of one package is
402
 
somehow more pleasing than the interface of another.  Other users on the same
403
 
system might make a different choice.
404
 
</p>
405
 
 
406
 
<p>
407
 
Debian uses a &quot;virtual&quot; package system to allow system administrators
408
 
to choose (or let users choose) their favorite tools when there are two or more
409
 
that provide the same basic functionality, yet satisfy package dependency
410
 
requirements without specifying a particular package.
411
 
</p>
412
 
 
413
 
<p>
414
 
For example, there might exist two different versions of newsreaders on a
415
 
system.  The news server package might 'recommend' that there exist
416
 
<em>some</em> news reader on the system, but the choice of <samp>tin</samp> or
417
 
<samp>trn</samp> is left up to the individual user.  This is satisfied by
418
 
having both the <code>tin</code> and <code>trn</code> packages provide the
419
 
virtual package <code>news-reader</code>.  <em>Which</em> program is invoked is
420
 
determined by a link pointing from a file with the virtual package name
421
 
<samp>/etc/alternatives/news-reader</samp> to the selected file, e.g.,
422
 
<samp>/usr/bin/trn</samp>.
423
 
</p>
424
 
 
425
 
<p>
426
 
A single link is insufficient to support full use of an alternate program;
427
 
normally, manual pages, and possibly other supporting files must be selected as
428
 
well.  The Perl script <samp>update-alternatives</samp> provides a way of
429
 
ensuring that all the files associated with a specified package are selected as
430
 
a system default.
431
 
</p>
432
 
 
433
 
<p>
434
 
For example, to check what executables provide `x-window-manager', run:
435
 
</p>
436
 
 
437
 
<pre>
438
 
     update-alternatives --display x-window-manager
439
 
</pre>
440
 
 
441
 
<p>
442
 
If you want to change it, run:
443
 
</p>
444
 
 
445
 
<pre>
446
 
     update-alternatives --config x-window-manager
447
 
</pre>
448
 
 
449
 
<p>
450
 
And follow the instructions on the screen (basically, press the number next to
451
 
the entry you'd like better).
452
 
</p>
453
 
 
454
 
<p>
455
 
If a package doesn't register itself as a window manager for some reason (file
456
 
a bug if it's in error), or if you use a window manager from /usr/local
457
 
directory, the selections on screen won't contain your preferred entry.  You
458
 
can update the link through command line options, like this:
459
 
</p>
460
 
 
461
 
<pre>
462
 
     update-alternatives --install /usr/bin/x-window-manager \
463
 
       x-window-manager /usr/local/bin/wmaker-cvs 50
464
 
</pre>
465
 
 
466
 
<p>
467
 
The first argument to `--install' option is the symlink that points to
468
 
/etc/alternatives/NAME, where NAME is the second argument.  The third argument
469
 
is the program to which /etc/alternatives/NAME should point to, and the fourth
470
 
argument is the priority (larger value means the alternative will more probably
471
 
get picked automatically).
472
 
</p>
473
 
 
474
 
<p>
475
 
To remove an alternative you added, simply run:
476
 
</p>
477
 
 
478
 
<pre>
479
 
     update-alternatives --remove x-window-manager /usr/local/bin/wmaker-cvs
480
 
</pre>
481
 
 
482
 
<hr>
483
 
 
484
 
<p>
485
 
[ <a href="ch-kernel.en.html">previous</a> ]
486
 
[ <a href="index.en.html#contents">Contents</a> ]
487
 
[ <a href="ch-basic_defs.en.html">1</a> ]
488
 
[ <a href="ch-getting.en.html">2</a> ]
489
 
[ <a href="ch-compat.en.html">3</a> ]
490
 
[ <a href="ch-software.en.html">4</a> ]
491
 
[ <a href="ch-ftparchives.en.html">5</a> ]
492
 
[ <a href="ch-pkg_basics.en.html">6</a> ]
493
 
[ <a href="ch-pkgtools.en.html">7</a> ]
494
 
[ <a href="ch-uptodate.en.html">8</a> ]
495
 
[ <a href="ch-kernel.en.html">9</a> ]
496
 
[ 10 ]
497
 
[ <a href="ch-support.en.html">11</a> ]
498
 
[ <a href="ch-contributing.en.html">12</a> ]
499
 
[ <a href="ch-redistrib.en.html">13</a> ]
500
 
[ <a href="ch-nexttime.en.html">14</a> ]
501
 
[ <a href="ch-faqinfo.en.html">15</a> ]
502
 
[ <a href="ch-support.en.html">next</a> ]
503
 
</p>
504
 
 
505
 
<hr>
506
 
 
507
 
<p>
508
 
The Debian GNU/Linux FAQ
509
 
</p>
510
 
 
511
 
<address>
512
 
version 3.1.5, 17 January 2007<br>
513
 
<br>
514
 
Authors are listed at <a href="ch-faqinfo.en.html#s-authors">Debian FAQ Authors</a><br>
515
 
<br>
516
 
</address>
517
 
<hr>
518
 
 
519
 
</body>
520
 
 
521
 
</html>
522