CHAPTER



Guide to Linux Installation and Administration, 2e

Chapter 10 Solutions

Review QUESTIONS

1. Although the /proc file system is not stored on a hard disk, it is called a file system because:

a. It is accessed via a directory structure using standard commands that are also used for regular files.

2. The command ps -A xo comm will display the following information:

d. All processes running on the system, with the nice level and command-line fields displayed for each one.

3. The ______ field in the ps command output defines how much cumulative CPU time a process has used since it was launched.

a. TIME

4. The CMD field of the ps command output displays:

b. The command used to start the process shown on each line

5. Which of the following commands is invalid if run by a regular user?

a. renice -10 1035

6. Which of these programs does not allow you to change the nice level of a running process?

b. free

7. To update the process data displayed by the top command, you would press which key?

b. Spacebar

8. Dynamically linked applications are preferred for their better memory usage unless:

c. The necessary libraries to run the application are not installed on the Linux system.

9. Thrashing occurs when:

a. An excessive amount of information is moved to and from the swap partition in a short time.

10. A bottleneck occurs in a Linux system when:

c. One part of the system restricts adequate system performance because it cannot keep up with the demands of other system components and applications.

11. The bonnie program is useful for determining which of the following:

a. Hard disk performance data

12. The command vmstat 4 will do which of the following:

c. Display continuous updates of the virtual memory status on a new line every four seconds.

13. Log files are generally not used for which of the following tasks?

c. Calculating memory usage for applications

14. Given the log entry,

Oct 26 06:45:01 brighton httpd: Cannot determine local host name

the word httpd refers to which of the following?

b. The program that generated the event being logged

15. Explain the differences between the syslogd and the klogd logging daemons.

The first logs messages generated by programs (including other daemons); the second logs messages generated by the Linux kernel.

16. The syslogd and klogd logging daemons depend upon which configuration file?

b. syslog.conf

17. A configuration pair consisting of a facility and a priority is called:

c. A selector

18. If *.info appears in the log configuration file, the following will be logged:

a. Messages from all facilities with a priority of info or higher

19. Which of the following is not a valid facility name?

b. httpd

20. This configuration line

*.emerg @brighton

will cause which of the following to occur?

c. All messages with a priority emerg are sent to the machine named brighton for logging.

21. This configuration line

*.info:mail,news.none:authpriv.none -/var/log/messages

is invalid because:

a. A colon cannot be used to separate multiple selectors.

22. Describe why the system logging daemons must be reinitialized using a HUP signal in order to access new configuration files.

So that they start to use the inode of the new /var/log/messages file instead of the previous inode, which may have been renamed as a log archive file.

23. The logger utility does which of the following?

a. Sends messages to the syslog function for logging according to the syslog.conf file

24. Which of the following is a valid reason to rotate your log files?

b. The files become too large to store permanently on the root partition.

25. If you saw the message

login: FAILED LOGIN 3 FROM (null) for rajw, Authentication failure

you might reasonably assume any of the following except:

c. The login program has become corrupted.

Hands-on Projects

[pic]Project 10-1

4. Click View on the menu bar and select Only TTY Processes. This limits the list of processes to those associated with one of the Linux terminals. Can you identify some processes that are removed from the list when you choose this option?

Most of them are removed, including all of those associated with the Gnome desktop except for gtop, which is run in a special way so it can manage other processes.

5. Click View and select Only TTY Processes again to deselect that option. Click View again, then click Hide System Processes. How would you describe the process list now?

Its very short. Most processes are system processes.

14. View the components of gedit. What do you notice about them?

The great majority of gedit is shared Gnome-related libraries.

[pic]Project 10-2

8. Watch the values in the output of the free command change. Do the values in vmstat change as well? What additional information can you see in the vmstat output? If you opened a second copy of Mozilla or Netscape, how do the shared libraries used by the two copies of the same program affect the memory usage when you started a second copy?

The values in free and vmstat depend on the exact state of your system as you launch multiple applications. The shared libraries mean that less memory is required for each additional copy of the browser than was required for the first copy you launched.

10. As you read the output of these system administration tools, what can you conclude about how these tools affect system performance? What comments would you make about the value of using graphical system-monitoring tools such as those mentioned in this chapter?

System monitoring tools place a load on the system they are monitoring, though on a busy system the relative load is minimal. Graphical tools place a heavier burden than utilities like top, free, or vmstat. Graphical tools, however, are generally much easier to use, especially for those new to Linux. All of the results from the above steps will vary depending on the programs selected and the amount of RAM installed on the system.

[pic] Project 10-3

5. In the second window, enter killall -HUP httpd to restart any Web server daemons running on your system. Were any messages added? Are any copies of httpd running on your system? How can you check?

On Red Hat Linux 7.3, most installations will not have httpd running by default. This can be checked using the command ps ax|grep.

[pic] Project 10-4

6. Using the facility and priority names you have learned, try sending one or two other messages using the logger program. In particular, try sending a message with the priority emerg. For example, you might use this command:

# logger -p user.emerg -t TESTING Emergency message test.

What do you notice about how this command is treated compared to the other logger commands you entered? Can you explain why, based on the information in the syslog.conf file?

It is treated somewhat differently because it is coming from the user facility.

Case Projects

3. The Web servers used in your project rely on database programs that feed them information. The data is requested using scripts that you have written to query the databases and return results as Web pages. What technique could you use to track exactly which queries are being used most frequently? You need a technique that doesn’t slow down the system by pausing, or require that you sit in front of the computer watching a screen listing of activities. When you decide on the technique, write a few sample command lines that you will use and a sample configuration file line that will enable the commands to work.

This case assumes the reader will use the logger command within a script to log activity for each query type. The syslog.conf file would need to be updated to capture the messages in the preferred format.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download