Chapter 10. Special Features of SUSE LINUX

Table of Contents

10.1. Information about Special Software Packages
10.2. Virtual Consoles
10.3. Keyboard Mapping
10.4. Language and Country-Specific Settings

Abstract

This chapter provides information about various software packages, the virtual consoles, and the keyboard layout. This is followed by a section about language and country-specific settings (I18N and L10N).

10.1. Information about Special Software Packages

10.1.1. The Package bash and /etc/profile

The following is a list of all init files read by Bash when it is used as a login shell. Bash processes them in the order they appear in this list.

  1. /etc/profile

  2. ~/.profile

  3. /etc/bash.bashrc

  4. ~/.bashrc

Users can make personal entries in ~/.profile or in ~/.bashrc. To ensure the correct processing of these files, it is necessary to copy the basic settings from /etc/skel/.profile or /etc/skel/.bashrc into the home directory of the user. It is recommended to copy the settings from /etc/skel following an update. Execute the following shell commands to prevent the loss of personal adjustments:

mv ~/.bashrc ~/.bashrc.old
cp /etc/skel/.bashrc ~/.bashrc
mv ~/.profile ~/.profile.old
cp /etc/skel/.profile ~/.profile

The personal adjustments then need to be copied back from the files *.old.

10.1.2. The cron Package

The cron tables are located in /var/spool/cron/tabs. /etc/crontab serves as a systemwide cron table. Enter the name of the user who should run the command directly after the time table. In Example 10.1, “Example of an Entry in /etc/crontab”, root is entered. Package-specific tables, located in /etc/cron.d, have the same format. See man cron.

Example 10.1. Example of an Entry in /etc/crontab

1-59/5 * * * * root test -x /usr/sbin/atrun && /usr/sbin/atrun

/etc/crontab cannot be processed with crontab -e. It must be loaded directly into an editor, modified, then saved.

A number of packages install shell scripts to the directories /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly, whose instructions are controlled by /usr/lib/cron/run-crons. /usr/lib/cron/run-crons is run every 15 minutes from the main table (/etc/crontab). This guarantees that processes that may have been neglected can be run at the proper time.

The daily system maintenance jobs have been distributed to various scripts for reasons of clarity. They are contained in the package aaa_base. /etc/cron.daily contains, for instance, the components backup-rpmdb, clean-tmp, or clean-vi.

10.1.3. Log Files: Package logrotate

There are a number of system services (daemons), which, along with the kernel itself, regularly record the system status and specific events to log files. This way, the administrator can regularly check the status of the system at a certain point in time, recognize errors or faulty functions, and troubleshoot them with pinpoint precision. These log files are normally stored in /var/log as specified by FHS and grow on a daily basis. The logrotate package helps control the growth of these files.

10.1.3.1. Configuration

Configure logrotate with the file /etc/logrotate.conf. In particular, the include specification primarily configures the additional files to read. SUSE LINUX ensures that programs that produce log files install individual configation files in /etc/logrotate.d. For example, such programs come with the packages apache2 (/etc/logrotate.d/apache2) and syslogd (/etc/logrotate.d/syslog).

Example 10.2. Example for /etc/logrotate.conf

# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own lastlog or wtmp - we'll rotate them here
#/var/log/wtmp {
#    monthly
#    create 0664 root utmp
#    rotate 1
#}

# system-specific logs may be also be configured here.

logrotate is controlled through cron and is called daily by /etc/cron.daily/logrotate.

[Important]Important

The create option reads all settings made by the administrator in /etc/permissions*. Ensure that no conflicts arise from any personal modifications.

10.1.4. Man Pages

For some GNU applications (such as tar), the man pages are no longer maintained. For these commands, use the --help option to get a quick overview of the info pages, which provide more in-depth instructions. info is GNU's hypertext system. Read an introduction to this system by entering info info. Info pages can be viewed with Emacs by entering emacs -f info or directly in a console with info. You can also use tkinfo, xinfo, or the SUSE help system to view info pages.

10.1.5. The Command locate

locate, a command for quickly finding files, is not included in the standard scope of the installed software. If necessary, install the package (find-locate). The updatedb process is started automatically every night or about 15 minutes after booting the system.

10.1.6. The Command ulimit

With the ulimit (user limits) command, it is possible to set limits for the use of system resources and to have these displayed. ulimit is especially useful for limiting the memory available for applications. With this, an application can be prevented from using too much memory on its own, which could bring the system to a standstill.

ulimit can be used with various options. To limit memory usage, use the options listed in Table 10.1, “ulimit: Setting Resources for the User”.

Table 10.1. ulimit: Setting Resources for the User

-m

maximum size of physical memory

-v

maximum size of virtual memory

-s

maximum size of the stack

-c

maximum size of the core files

-a

display of limits set

Systemwide settings can be made in /etc/profile. There, enable creation of core files, needed by programmers for debugging. A normal user cannot increase the values specified in /etc/profile by the system administrator, but he can make special entries in his own ~/.bashrc.

Example 10.3. ulimit: Settings in ~/.bashrc

# Limits of physical memory:
ulimit -m 98304
 
# Limits of virtual memory:
ulimit -v 98304

Memory amounts must be specified in KB. For more detailed information, see man bash.

[Important]Important

Not all shells support ulimit directives. PAM (for instance, pam_limits) offers comprehensive adjustment possibilities if you depend on encompassing settings for these restrictions.

10.1.7. The free Command

The free command is somewhat misleading if your goal is to find out how much RAM is currently being used. The relevant information can be found in /proc/meminfo. These days, users with access to a modern operating system, such as Linux, should not really need to worry much about memory. The concept of available RAM dates back to before the days of unified memory management. The slogan free memory is bad memory applies well to Linux. As a result, Linux has always made the effort to balance out caches without actually allowing free or unused memory.

Basically, the kernel does not have direct knowledge of any applications or user data. Instead, it manages applications and user data in a page cache. If memory runs short, parts of it are written to the swap partition or to files, from which they can initially be read with the help of the mmap command (see man mmap).

Furthermore, the kernel also contains other caches, such as the slab cache, where the caches used for network access are stored. This may explain differences between the counters in /proc/meminfo. Most, but not all of them, can be accessed via /proc/slabinfo.

10.1.8. The File /etc/resolv.conf

Domain name resolution is handled through the file /etc/resolv.conf. Refer to Chapter 24, The Domain Name System.

This file is updated by the script /sbin/modify_resolvconf exclusively, with no other program having permission to modify /etc/resolv.conf directly. Enforcing this rule is the only way to guarantee that the system's network configuration and the relevant files are kept in a consistent state.

10.1.9. Settings for GNU Emacs

GNU Emacs is a complex work environment. More information is available at http://www.gnu.org/software/emacs/. The following sections cover the configuration files processed when GNU Emacs is started.

On start-up, Emacs reads several files containing the settings of the user, system administrator, and distributor for customization or preconfiguration. The initialization file ~/.emacs is installed to the home directories of the individual users from /etc/skel. .emacs, in turn, reads the file /etc/skel/.gnu-emacs. To customize the program, copy .gnu-emacs to the home directory (with cp /etc/skel/.gnu-emacs ~/.gnu-emacs) and make the desired settings there.

.gnu-emacs defines the file ~/.gnu-emacs-custom as custom-file. If users make settings with the customize options, these are saved to ~/.gnu-emacs-custom.

With SUSE LINUX, the emacs package installs the file site-start.el in the directory /usr/share/emacs/site-lisp. The file site-start.el is loaded before the initialization file ~/.emacs. Among other things, site-start.el ensures that special configuration files distributed with Emacs add-on packages, such as psgml, are loaded automatically. Configuration files of this type are located in /usr/share/emacs/site-lisp, too, and always begin with suse-start-. The local system administrator can specify systemwide settings in default.el.

More information about these files is available in the Emacs info file under Init File: info:/emacs/InitFile. Information about how to disable loading these files (if necessary) is also provided at this location.

The components of Emacs are divided into several packages:

  • The base package emacs.

  • emacs-x11 (usually installed): the program with X11 support.

  • emacs-nox: the program without X11 support.

  • emacs-info: online documentation in info format.

  • emacs-el: the uncompiled library files in Emacs Lisp. These are not required at run-time.

  • Numerous add-on packages can be installed if needed: emacs-auctex (for LaTeX), psgml (for SGML and XML), gnuserv (for client and server operation), and others.

10.1.10. Brief Introduction to vi

Text editors are still used for many system administration tasks as well as for programming. In the world of Unix, vi stands out as an editor that offers comfortable editing functions and is more ergonomic than many editors with mouse support.

10.1.10.1. Operating Modes

Basically, vi makes use of three operating modes: insert mode, command mode, and extended mode. The keys have different functions depending on the mode. On start-up, vi is normally set to the command mode. The first thing to learn is how to switch between the modes:

Command Mode to Insert Mode

There are many possibilities, including A for append, I for insert, or O for a new line under the current line.

Insert Mode to Command Mode

Press Esc to exit the insert mode. vi cannot be terminated in insert mode, so it is important to get used to pressing Esc.

Command Mode to Extended Mode

The extended mode of vi can be activated by entering a colon (:). The extended or ex mode is like an independent line-oriented editor that can be used for various simple and more complex tasks.

Extended Mode to Command Mode

After executing a command in extended mode, the editor automatically returns to command mode. If you decide not to execute any command in extended mode, delete the colon with . The editor returns to command mode.

It is not possible to switch directly from insert mode to extended mode without first switching to command more.

vi, like other editors, has its own procedure for terminating the program. You cannot terminate vi while in insert mode. First, exit insert mode by pressing Esc. Subsequently, you have two options:

  1. Exit without saving: To terminate the editor without saving the changes, enter : Q ! in command mode. The exclamation mark (!) causes vi to ignore any changes.

  2. Save and exit: There are several possibilities to save your changes and terminate the editor. In command mode, use Z Z. To exit the program saving all changes from the extended mode, enter : W Q. In extended mode, W stands for “write” and Q for “quit”.

10.1.10.2. vi in Action

vi can be used as a normal editor. In insert mode, enter text and delete text with the and keys. Use the arrow keys to move the cursor.

However, these control keys often cause problems, because there are many terminal types that use special key codes. This is where the command mode comes into play. Press Esc to switch from insert mode to command mode. In command mode, move the cursor with H, J, K, and L. The keys have the following functions:

H

move one character to the left

J

move one line down

K

move one line up

L

move one character to the right

The commands in command mode allow diverse variations. To execute a command several times, simply enter the number of repetitions before entering the actual command. For example, enter 5 L to move the cursor five characters to the right.

10.1.10.3. For More Information

vi supports a wide range of commands. It enables the use of macros, shortcuts, named buffers, and many other useful features. A detailed description of the various options would exceed the scope of this manual. SUSE LINUX comes with vim (vi improved), an improved version of vi. There are numerous information sources for this application:

[Important]The VIM License

vim is “charityware,” which means that the authors do not charge any money for the software but encourage you to support a nonprofit project with a monetary contribution. This project solicits help for poor children in Uganda. More information is available online at http://iccf-holland.org/index.html, http://www.vim.org/iccf/, and http://www.iccf.nl/.


SUSE LINUX Administration Guide 9.3