Flylib.com

Books Software

 
 
 

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.



Chapter 17. Shells , Scripting, Programming, and Compiling (Topic 1.109)

Depending upon the computing environments you're used to, the concepts of shells and shell programs (usually called scripts ) may be a little foreign. On Linux systems, the shell is a full programming environment that can be scripted or used interactively.

This chapter covers Topic 1.109 and its two Objectives:



Objective 1: Customize and Use the Shell Environment

This Objective covers your shell and basic scripting concepts, including environment variables , functions, and script files that control the login environment. Weight: 5.



Objective 2: Customize or Write Simple Scripts

Customization of the many scripts found on a Linux system is important for its management and automation. Topics for this Objective include shell syntax, checking the status of executed programs, and issues surrounding the properties of script files. Weight: 3.

It is important for Linux administrators to become comfortable with at least one shell and its programming language. This can be an area of some concern to those used to graphics-only environments, where the use of a command interpreter is not a daily activity. As you'll see, becoming adept at working with your favorite shell will empower you and will allow you to let your computer carry a larger share of your daily responsibilities.