[ Team LiB ] Previous Section Next Section

Communicating with Users

An important part of your job as a system administrator is communicating with users to let them know that a task you are performing can affect their ability to use a system. Always let users know when you are about to perform a task that affects them, such as rebooting a system, installing new software, or changing the environment in some way.

You can communicate with users by personal visit or phone, but the most common way is by using the system to notify users in one of the following ways.

  • Display a system-specific message at login by using the message of the day.

  • Send a message directly to an individual user's terminal by using the write command.

  • Send a message to all users on a system by using the wall command.

  • Send a message to all users on a network by using the rwall command.

  • Send a message to an individual or a group of users by electronic mail.

Displaying System-Specific Messages at Login (motd)

Each time a user logs in to a system, the message of the day in the file /etc/motd is displayed. The message is not displayed to users who are already logged in and are using the system. Use motd to give users system-specific information that someone logging in would want to know. This information might include the release number of the installed operating system, changes to system software, the name of the newly installed (or deleted) third-party software, or a list of scheduled downtimes.

Be sure to keep the motd file current. If motd displays outdated messages, users may begin to ignore all the messages, thereby missing critical information when it is presented. Keep the message short: If the message is longer than a screenful of information, users won't be able to read the beginning because it will scroll off the top of the screen before they have a chance to read it.

Root should own the /etc/motd file and be the only user who has write permission to it.


oak% ls -l /etc/motd
-rw-r--r--   1 root    sys    49 Jan  1  1970  /etc/motd
oak%

NOTE. When the system software is installed, several files, including /etc/motd, have a time stamp of "Jan 1 1970." This date is the beginning of UNIX time. When you edit these files, the time stamp is updated.


The default /etc/motd file contains information about the Solaris release level. The following example shows the default /etc/motd file for Solaris 8.


paperbark% more /etc/motd
Sun Microsystems Inc.   SunOS 5.8      Generic  February 2000
paperbark%


Creating a Message of the Day

Use the following steps to create a message of the day.

  1. Become superuser.

  2. Use an editor such as vi to edit the /etc/motd file.

  3. Delete any existing messages and type the new one.

  4. Save the changes.

    The message is changed and is displayed the next time a user logs in to the system.

Sending a Message to an Individual User

You can send a message to the terminal of an individual user by using the write command. When a windowing system such as CDE or OpenWindows is used, each window is considered a separate login. If the user is logged in more than once, the message is directed to the console window.

NOTE. In the CDE environment, users may or may not use a console window. If the console window is not open, the user never sees the message because it is not displayed if the user opens a console window after the write message has been received.


Typing a Short Message to an Individual User (write)

Use the following steps to send a short, one-time message to an individual user.

  1. Type write username and press Return. username is the login name of the user.

  2. Type the message you want to send.

  3. When the message is complete, press Control-D.

    The message is displayed in the user's console window.

The following example shows a message a system administrator might type.


# write winsor
winsor is logged on more than one place.
You are connected to "console".
Other locations are:
pts/3
pts/4
pts/5
pts/6
pts/7
I'll come by at 12:00 to look at your problem.
#

As you can see, winsor is logged in to more than one place and write tells you that it is sending the message to the console window. The message is displayed in the user's console window, as shown in the following example.


paperbark%
        Message from winsor on paperbark (pts/6) [ Tue Mar 7 16:40:09 ] ...
I'll come by at 12:00 to look at your problem.
<EOT>

graphics/new.gif

However, if you are concerned that the user is not using the console window, you can use the write username terminal command to send the write message to any of the other terminals listed.

Sending a Message from a File to an Individual User (write)

If you have a longer message that you want to send to a number of users, use the following steps to create the message in a file and then use the file name as an argument to the write command.

  1. Create a file containing the text of the message you want to send.

  2. Type write username < filename and press Return.

In the following example, the system administrator uses the cat command to create a file named message that contains a short message and then uses the write command to send the message.


oak% cat > message
I'll come by at 12:00 to look at your problem.
oak% write ignatz@elm < message
write: ignatz logged in more than once ... writing to console
oak%

If the user is logged in to more than one window, the message is displayed in the user's console window, as shown below.


Message from fred@oak on ttyp1 at 11:20 ...
I'll come by at 12:00 to look at your problem.
EOF

As you can see, the user doesn't see any difference in the output created from a typed message and the message included from a file. The user can initiate a dialogue by using the write command to respond, but the dialogue is not truly interactive. Two write paths are open, one in each direction. See the write(1) manual page for more information. For more information about manual pages, see "Using Manual Pages" on page 94.

Sending a Message to All Users on a System or Network (wall, rwall)

You can use the wall (write all) command to simultaneously send a message to every user on a system. You can use the rwall (remote write all) command to simultaneously send a message to the console window of every user on a network.

NOTE. In the CDE environment, users may not use a console or a terminal window. If no console or terminal windows are opened, the user never sees the message because it is not displayed if the user opens a window after the wall message has been received.


Use the following steps to send a message to all users on a system.

  1. Type wall and press Return.

  2. Type the message you want to send.

  3. When the message is complete, press Control-D. The message is displayed in the console window of each user on the system.

The following example shows a message a system administrator might type.


oak% wall
System will be rebooted at 12:00.
oak%

The message is displayed in the users' console window, as shown below.


Broadcast message from root on console ...
System will be rebooted at 12:00.
EOF

NOTE. Use the rwall command carefully because it consumes extensive system and network resources.


Use the following steps to send a message to all users of a group.

  1. Type rwall -n group and press Return.

  2. Type the message you want to send.

  3. When the message is complete, press Control-D. The message is displayed in the console window of each user on the system.

The following example shows a message the system administrator might type to send to all members of the netgroup Eng.


oak% rwall -n Eng
System oak will be rebooted at 12:00.
oak%

The message is displayed in the users' console window, as shown below.


Broadcast message from root on console ...
System will be rebooted at 12:00.

You can also use the rwall command to send a message to all users on a system by typing rwall hostname.

graphics/new.gif

NOTE. At many security-conscious sites, system administrators disable the rwall command by commenting out the walld daemon line in the /etc/inetd.conf file.


Sending a Message by E-Mail

E-mail is an effective way to communicate some system administration informational messages. However, this book does not describe how to use electronic mail. See the mail(1), mailtool(1), mailx(1), and dtmail(1X) manual pages for information about the mail programs.

    [ Team LiB ] Previous Section Next Section