Section 16.3. Objective 5: Notify Users on System-related Issues


16.3. Objective 5: Notify Users on System-related Issues

A key, but difficult to test, skill for Linux sysadmins is the ability to communicate with your system users. Rather than require a face-to-face visit with you to test your communication skills, LPI covers only the system-related resources to help you relay information to your system users.

There are a variety of methods to relay information to your users. For general communication or notices, you may opt to simply send a broadcast email to all users on your system. For the LPI exams, however, you are simply expected to make use of the /etc/issue and /etc/motd files on your server, which notify shell users.

16.3.1. /etc/issue

The /etc/issue file is responsible for the text that appears after a login at the system console. The text that appears when you log in remotely is controlled by /etc/issue.net.

Both issue files are completely text based and can contain anything from a customized system introduction to basic system information or specialized system notifications. The information within these files can be escape sequences to generate relevant system information such as the current date, time, number of system users, kernel release, and even operating system version. Some common options are listed in Table 16-5.

Table 16-5. Common escape characters

Character

Description

\d

Insert the current date.

\m

Insert the architecture identifier of the machine, e.g., i686

\n

Insert the node name of the machine, also known as the hostname.

\o

Insert the domain name of the system.

\r

Insert the release number of the kernel, e.g., 2.4.20.

\s

Insert the system name, the name of the operating system.

\t

Insert the current time.

\u

Insert the number of current users logged in.

v

Insert the version of the OS.

\U

Insert the string "n users" where n is the number of current users logged in.


16.3.1.1. Example

The following is a simple example of an /etc/issue file. The same content may be used within /etc/issue.net.

 $ cat /etc/issue Red Hat Linux release 9 (Shrike) Kernel \r on an \m 

The result of this /etc/issue looks like this:

 Red Hat Linux release 9 (Shrike) Kernel 2.4.20-18.9 on an i686 

16.3.2. /etc/motd

The /etc/motd is intended to be used as the message of the day. Its development was designed to get messages to system users using less disk space than required by sending mass email. The format of /etc/motd, like /etc/issue, is text based.



LPI Linux Certification in a Nutshell
LPI Linux Certification in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596005288
EAN: 2147483647
Year: 2004
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net