~ubuntu-branches/ubuntu/raring/doc-debian/raring

« back to all changes in this revision

Viewing changes to FAQ/customizing.sgml

  • Committer: Bazaar Package Importer
  • Author(s): Josip Rodin
  • Date: 2002-04-30 19:02:09 UTC
  • Revision ID: james.westby@ubuntu.com-20020430190209-v94hhhb9wj0kz552
Tags: 3.0
* Updated for the imminent woody release.
* Updated BTS docs from the FTP site, closes: #133422, #133440.
* Updated description of frozen, closes: #142801.
* Built a PDF version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<chapt id="customizing">Customizing your installation of &debian;
 
2
 
 
3
<sect id="papersize">How can I ensure that all programs use the same
 
4
  paper size?
 
5
 
 
6
<p>Install the <package/libpaperg/ package, and it will ask you for a
 
7
system-wide default paper size. This setting will be kept in the file
 
8
<tt>/etc/papersize</tt>.
 
9
 
 
10
<p>Users can override the paper size setting using the <tt>PAPERSIZE</tt>
 
11
environment variable. For details, see the manual page
 
12
<manref name="papersize" section="5">.
 
13
 
 
14
<sect id="hardwareaccess">How can I provide access to hardware peripherals,
 
15
  without compromising security?
 
16
 
 
17
<p>Many device files in the <tt>/dev</tt> directory belong to some
 
18
predefined groups. For example, <tt>/dev/fd0</tt> belongs to the
 
19
<tt>floppy</tt> group, and <tt>/dev/dsp</tt> belongs to the
 
20
<tt>audio</tt> group.
 
21
 
 
22
<p>If you want a certain user to have access to one of these devices, just
 
23
add the user to the group the device belongs to, i.e. do:
 
24
  <example>adduser user group</example>
 
25
This way you won't have to chmod the device file.
 
26
 
 
27
<sect id="consolefont">How do I load a console font on startup the Debian way?
 
28
 
 
29
<p>The <package/kbd/ and <package/console-tools/ packages support this,
 
30
edit <tt>/etc/kbd/config</tt> or <tt>/etc/console-tools/config</tt> files.
 
31
 
 
32
<sect id="appdefaults">How can I configure an X11 program's application
 
33
  defaults?
 
34
 
 
35
<p>Debian's X programs will install their application resource data in the
 
36
<tt>/etc/X11/app-defaults/</tt> directory. If you want to customize X
 
37
applications globally, put your customizations in those files. They are
 
38
marked as configuration files, so their contents will be preserved during
 
39
upgrades.
 
40
 
 
41
<sect id="booting">Every distribution seems to have a different boot-up
 
42
  method.  Tell me about Debian's.
 
43
 
 
44
<p>Like all Unices, Debian boots up by executing the program <tt>init</tt>.
 
45
The configuration file for <tt>init</tt> (which is <tt>/etc/inittab</tt>)
 
46
specifies that the first script to be executed should
 
47
be <tt>/etc/init.d/rcS</tt>.  This script checks and mounts file systems,
 
48
loads modules, starts the network services, sets the clock, performs other
 
49
initialization, and then runs all of the scripts (except those with a `.'
 
50
in the filename) in <tt>/etc/rc.boot/</tt>. Any scripts in the latter
 
51
directory are usually reserved for system administrator use, and using them
 
52
in packages is deprecated.
 
53
 
 
54
<p>After completing the boot process, <tt>init</tt> executes all start
 
55
scripts in a directory specified by the default runlevel (this runlevel
 
56
is given by the entry for <tt>id</tt> in <tt>/etc/inittab</tt>).
 
57
Like most <!-- all? SGK --> System V compatible Unices, Linux has 7 runlevels:
 
58
<list>
 
59
  <item>0 (halt the system),
 
60
  <item>1 (single-user mode),
 
61
  <item>2 through 5 (various multi-user modes), and
 
62
  <item>6 (reboot the system).
 
63
</list>
 
64
Debian systems come with id=2, which indicates that the default
 
65
runlevel will be '2' when the multi-user state is entered, and the
 
66
scripts in <tt>/etc/rc2.d/</tt> will be run.
 
67
 
 
68
<p>In fact, the scripts in any of the directories, <tt>/etc/rcN.d/</tt>
 
69
are just symbolic links back to scripts in <tt>/etc/init.d/</tt>.  However,
 
70
the <em>names</em> of the files in each of the <tt>/etc/rcN.d/</tt>
 
71
directories are selected to indicate the <em>way</em> the scripts in
 
72
<tt>/etc/init.d/</tt> will be run.  Specifically, before entering any
 
73
runlevel, all the scripts beginning with 'K' are run; these scripts kill
 
74
services.  Then all the scripts beginning with 'S' are run; these scripts
 
75
start services.  The two-digit number following the 'K' or 'S' indicates
 
76
the order in which the script is run.  Lower numbered scripts are executed
 
77
first.
 
78
 
 
79
<p>This approach works because the scripts in <tt>/etc/init.d/</tt> all
 
80
take an argument which can be either `start', `stop', `reload', `restart'
 
81
or `force-reload' and will then do the task indicated by the argument.
 
82
These scripts can be used even after a system has been booted, to control
 
83
various processes.
 
84
 
 
85
<p>For example, with the argument `reload' the command
 
86
  <example>/etc/init.d/sendmail reload</example>
 
87
sends the sendmail daemon a signal to reread its configuration file.
 
88
 
 
89
<sect id="custombootscripts">It looks as if Debian does not use
 
90
  <tt>rc.local</tt> to customize the boot process; what facilities
 
91
  are provided?
 
92
 
 
93
<p>Suppose a system needs to execute script <tt>foo</tt> on start-up,
 
94
or on entry to a particular (System V) runlevel.  Then the system
 
95
administrator should:
 
96
<list>
 
97
  <item>Enter the script <tt>foo</tt> into the directory <tt>/etc/init.d/</tt>.
 
98
  <item>Run the Debian command <tt>update-rc.d</tt> with appropriate
 
99
  arguments, to set up links between the (command-line-specified) directories
 
100
  rc?.d and <tt>/etc/init.d/foo</tt>.  Here, '?' is a number from 0 through 6
 
101
  and corresponds to each of the System V runlevels.
 
102
  <item>Reboot the system.
 
103
</list>
 
104
 
 
105
<p>The command <tt>update-rc.d</tt> will set up links between files in
 
106
the directories rc?.d and the script in <tt>/etc/init.d/</tt>.
 
107
Each link will begin with a 'S' or a 'K', followed by a number, followed
 
108
by the name of the script.  Scripts beginning with 'S' in
 
109
<tt>/etc/rcN.d/</tt> are executed when runlevel <tt>N</tt> is entered.
 
110
Scripts beginning with a 'K' are executed when leaving runlevel <tt>N</tt>.
 
111
 
 
112
<p>One might, for example, cause the script <tt>foo</tt> to execute at
 
113
boot-up, by putting it in <tt>/etc/init.d/</tt> and installing the links with
 
114
<tt>update-rc.d foo defaults 19</tt>.  The argument 'defaults' refers
 
115
to the default runlevels, which are 2 through 5.  The argument '19' ensures
 
116
that <tt>foo</tt> is called before any scripts containing numbers 20
 
117
or larger.
 
118
 
 
119
<sect id="interconffiles">How does the package management system deal with
 
120
  packages that contain configuration files for other packages?
 
121
 
 
122
<p>Some users wish to create, for example, a new server by installing a
 
123
group of Debian packages and a locally generated package consisting of
 
124
configuration files.  This is not generally a good idea, because <prgn/dpkg/
 
125
will not know about those configuration files if they are in a different
 
126
package, and may write conflicting configurations when one of the
 
127
initial "group" of packages is upgraded.
 
128
 
 
129
<p>Instead, create a local package that modifies the configuration files
 
130
of the "group" of Debian packages of interest.  Then <prgn/dpkg/ and the
 
131
rest of the package management system will see that the files have been
 
132
modified by the local "sysadmin" and will not try to overwrite them when
 
133
those packages are upgraded.
 
134
 
 
135
<!-- check against dpkg-divert description -->
 
136
<sect id="divert">How do I override a file installed by a package, so that
 
137
  a different version can be used instead?
 
138
 
 
139
<p>Suppose a sysadmin or local user wishes to use a program "login-local"
 
140
rather than the program "login" provided by the Debian <package/login/
 
141
package.
 
142
 
 
143
<p>Do <strong/not/:
 
144
<list>
 
145
  <item>Overwrite <tt>/bin/login</tt> with <tt>login-local</tt>.
 
146
</list>
 
147
The package management system will not know about this change, and will simply
 
148
overwrite your custom <tt>/bin/login</tt> whenever <tt>login</tt> (or any
 
149
package that provides <tt>/bin/login</tt>) is installed or updated.
 
150
 
 
151
<!-- XXX dpkg-divert: is this correct ? -->
 
152
<p>Rather, do
 
153
<list>
 
154
  <item>Execute:
 
155
    <example>dpkg-divert --divert /bin/login.debian /bin/login</example>
 
156
  in order to cause all future installations of the Debian <package/login/
 
157
  package to write the file <tt>/bin/login</tt> to <tt>/bin/login.debian</tt>
 
158
  instead.
 
159
  <item>Then execute:
 
160
    <example>cp login-local /bin/login</example>
 
161
  to move your own locally-built program into place.
 
162
</list>
 
163
 
 
164
<p>Details are given in the manual page <manref name="dpkg-divert" section="8">.
 
165
 
 
166
<sect id="localpackages">How can I have my locally-built package included in
 
167
  the list of available packages that the package management system knows
 
168
  about?
 
169
 
 
170
<p>Execute the command:
 
171
 
 
172
<example>
 
173
dpkg-scanpackages BIN_DIR OVERRIDE_FILE [PATHPREFIX] > my_Packages
 
174
</example>
 
175
 
 
176
<p>where:
 
177
  <list>
 
178
    <item>BIN-DIR is a directory where Debian archive files (which usually
 
179
    have an extension of ".deb") are stored.
 
180
    <item>OVERRIDE_FILE is a file that is edited by the distribution
 
181
    maintainers and is usually stored on a Debian FTP archive at
 
182
    <tt>indices/override.main.gz</tt> for the Debian packages in
 
183
    the "main" distribution. You can ignore this for local packages.
 
184
    <item>PATHPREFIX is an <em>optional</em> string that can be prepended
 
185
    to the <tt>my_Packages</tt> file being produced.
 
186
  </list>
 
187
 
 
188
<p>Once you have built the file <tt>my_Packages</tt>, tell the package
 
189
management system about it by using the command:
 
190
 
 
191
<example>
 
192
dpkg --merge-avail my_Packages
 
193
</example>
 
194
 
 
195
<p>If you are using APT, you can add the local repository to your
 
196
<manref name="sources.list" section="5"> file, too.
 
197
 
 
198
<sect id="diverse">Some users like mawk, others like gawk; some like vim,
 
199
  others like elvis; some like trn, others like tin; how does Debian
 
200
  support diversity?
 
201
 
 
202
<p>There are several cases where two packages provide two different versions
 
203
of a program, both of which provide the same core functionality.  Users
 
204
might prefer one over another out of habit, or because the user
 
205
interface of one package is somehow more pleasing than the interface of
 
206
another.  Other users on the same system might make a different choice.
 
207
 
 
208
<p>Debian uses a "virtual" package system to allow system administrators
 
209
to choose (or let users choose) their favorite tools when there are two
 
210
or more that provide the same basic functionality, yet satisfy package
 
211
dependency requirements without specifying a particular package.
 
212
 
 
213
<p>For example, there might exist two different versions of newsreaders on
 
214
a system.  The news server package might 'recommend' that there exist
 
215
<em>some</em> news reader on the system, but the choice of <tt>tin</tt>
 
216
or <tt>trn</tt> is left up to the individual user.  This is satisfied by
 
217
having both the <package/tin/ and <package/trn/ packages provide the
 
218
virtual package <package/news-reader/.  <em>Which</em> program is
 
219
invoked is determined by a link pointing from a file with the virtual
 
220
package name <tt>/etc/alternatives/news-reader</tt> to the selected file,
 
221
e.g., <tt>/usr/bin/trn</tt>.
 
222
 
 
223
<p>A single link is insufficient to support full use of an alternate
 
224
program; normally, manual pages, and possibly other supporting files
 
225
must be selected as well.  The Perl script <tt>update-alternatives</tt>
 
226
provides a way of ensuring that all the files associated with a specified
 
227
package are selected as a system default.
 
228
 
 
229
<p>For example, to check what executables provide `x-window-manager', run:
 
230
  <example>update-alternatives --display x-window-manager</example>
 
231
If you want to change it, run:
 
232
  <example>update-alternatives --config x-window-manager</example>
 
233
And follow the instructions on the screen (basically, press the number
 
234
next to the entry you'd like better).
 
235
 
 
236
<p>If a package doesn't register itself as a window manager for some reason
 
237
(file a bug if it's in error), or if you use a window manager from /usr/local
 
238
directory, the selections on screen won't contain your preferred entry.
 
239
You can update the link through command line options, like this:
 
240
  <example>update-alternatives --install /usr/bin/x-window-manager \
 
241
  x-window-manager /usr/local/bin/wmaker-cvs 50</example>
 
242
 
 
243
<p>The first argument to `--install' option is the symlink that points to
 
244
/etc/alternatives/NAME, where NAME is the second argument. The third argument
 
245
is the program to which /etc/alternatives/NAME should point to, and the
 
246
fourth argument is the priority (larger value means the alternative will more
 
247
probably get picked automatically).
 
248
 
 
249
<p>To remove an alternative you added, simply run:
 
250
  <example>update-alternatives --remove x-window-manager /usr/local/bin/wmaker-cvs</example>