Red Hat LINUX 7.2 - OFFICIAL LINUX CUSTOMIZATION GUIDE Guida di Installazione Pagina 45

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 282
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 44
Chapter 2. The /proc File System 45
A good way to determine if a particular file can configured or is only designed to provide information
is to list it. If the file is writable, you may use it to configure the kernel in a certain way. For example,
a partial listing of /proc/sys/fs looks like this:
-r--r--r-- 1 root root 0 May 10 16:14 dentry-state
-rw-r--r-- 1 root root 0 May 10 16:14 dir-notify-enable
-r--r--r-- 1 root root 0 May 10 16:14 dquot-nr
-rw-r--r-- 1 root root 0 May 10 16:14 file-max
-r--r--r-- 1 root root 0 May 10 16:14 file-nr
In this listing, the files dir-notify-enable and file-max can be written to and, therefore, can be
used to configure the kernel. The other files only provide feedback on current settings.
Changing a value within a /proc/sys/ file is done by echoing the new value into the file. For
example, to enable the System Request Key on a running kernel, type the command:
echo 1 > /proc/sys/kernel/sysrq
This will change the sysrq file’s value from 0 (off) to 1 (on).
The purpose of the System Request Key is to allow you to immediately instruct the kernel to do
a number of important activities by using a simple key combination, such as immediately shutting
down or restarting a system, syncing all mounted file systems, or dumping important information to
your console. This feature is most useful when using a development kernel or if you are experienc-
ing system freezes. For more information on the System Request Key, refer to /usr/src/linux-
2.4/Documentation/sysrq.txt.
A few /proc/sys/ configuration files contain more than one value. In order to correctly send new
values to them, place a space character between each value passed with the echo command, such as
is done in this example:
echo 4 2 45 > /proc/sys/kernel/acct
Note
Any configuration changes you make using the echo command will disappear when the system is
restarted. To make your configuration changes take effect at the time the system is booted, see
Section 2.4.
The /proc/sys/ directory contains several subdirectories controlling different aspects of a running
kernel.
2.3.8.1. /proc/sys/dev/
This directory provides parameters for particular devices on the system. Most systems have at least
two directories, cdrom and raid, but customized kernels can have others, such as parport, which
provides the ability to share one parallel port between multiple device drivers.
The cdrom directory contains a file called info, which reveals a number of important CD-ROM
parameters:
CD-ROM information, Id: cdrom.c 3.12 2000/10/18
drive name: hdc
drive speed: 32
drive # of slots: 1
Vedere la pagina 44
1 2 ... 40 41 42 43 44 45 46 47 48 49 50 ... 281 282

Commenti su questo manuale

Nessun commento