Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Linux+ Certification Bible.pdf
Скачиваний:
46
Добавлен:
15.03.2015
Размер:
3.78 Mб
Скачать

496

Part VI Troubleshooting and Maintaining System Hardware

Always restart a process after changing the configuration file. If you don’t, the changes won’t take effect.

Configuration Files

6.3 Examine and edit configuration files based on symptoms of a problem using system utilities

You may find that a process is not working properly because an error has occurred in its configuration file. Even a simple typing mistake can cause an application or process to run abnormally, so you must take great care when editing these configuration files.

The config files for most system processes and applications are stored in the /etc directory with files ending in the .conf extension. These configuration files are mere text files, and can be manipulated with any good text editor.

This example employs the httpd.conf file for the Web server. Consider this problem: You have set your document root directory to a wrong location. Users that are trying to access the Web server find that they can’t access any documents, or (even worse) the document root location is set to a directory with sensitive files.

In this case, the administrator must edit the httpd.conf file and set the DocumentRoot directive to its correct location. Change it back to the default directory of /home/httpd/html and then save the httpd.conf file.

At this point, if your users try to immediately access the Web page, you will still have the original problem. This is because the process is still running with the original configuration file. To have the program read the new configuration file, you must tell the process to stop and start, or perform a restart.

Summary

This chapter details some basic steps of troubleshooting a problem. This chapter describes many tools and resources to aid in finding a solution to your issue as efficiently as possible. For the exam, keep in mind the following key points:

Methodology and Best Practices

Never overlook the obvious

Work your way from the simple to the complex

Document your solution

Chapter 16 Linux Troubleshooting Basics 497

Resources

Linux User Groups, Linux Documentation Project

News groups, mailing lists

MAN pages, HOWTOs

System Log Files

/var/log/messages: Main system kernel log file — examine it frequently

/var/log/mesg: Kernel boot messages

Command Line Tools

cat: Print a file to the screen

grep: Find a pattern of text in a file

head / tail: Examine the top or bottom of a text file

more: Read files a screen at a time

| and >, >>: Used to redirect output to another program or output file

locate, find: Used to find the location of files

Process management

Scripts located in /etc/rc.d/init.d

Commands include start, stop, restart

Use ps -ef to find running processes

Configuration files: Most are located in /etc, end in .conf extension

498 Chapter 16 Study Guide

STUDY GUIDE

The Study Guide section provides you with the opportunity to test your knowledge about the Linux+ exam objectives that are covered in this chapter. The Assessment Questions provide practice for the real exam, and the Scenarios provide practice with real situations. If you get any questions wrong, use the answers to determine the part of the chapter that you should review before continuing.

Assessment Questions

1.Users are complaining that Samba services are not working properly. The administrator checks that the service is running. What can the administrator do to fix the problem?

A.Reboot the system

B.Reload the samba configuration file

C.Kill the samba service

D.Restart the samba service

2.A Linux system has been rebooted. When it starts up, no display appears on the screen and the system is beeping. What may this indicate?

A.The monitor is not connected

B.BIOS is indicating a system board problem

C.One of the hard drives is out of space

D.The Linux kernel is corrupted

3.A Linux system has crashed. The server is restarted, but a message appears, indicating that the operating system can’t be found. What is the most likely cause of the problem?

A.The hard drive has failed

B.The kernel needs to be upgraded

C.The motherboard has failed

D.The network card has failed

Chapter 16 Study Guide 499

4.A Linux administrator is having a difficult time locating the configuration file httpd.conf for the Web server. What command line tool can aid in finding the file?

A.tail

B.cat

C.grep

D.locate

5.A Linux administrator is noticing odd system behavior. Which log file can be examined to find general system log messages?

A./var/cron/messages

B./var/log/maillog

C./var/log/messages

D./etc/httpd/log

6.A Linux administrator is having trouble with the options for a particular command. What is the best resource to use for information on the command?

A.MAN pages

B.Linux Documentation Project

C.Linux distribution home page

D.Usenet newsgroups

7.An administrator is reading through a lengthy log file in order to find out why a certain application keeps crashing. What command can be used to simplify the log search using a search string?

A.find

B.cat

C.grep

D.locate

8.A programmer is constantly making changes to his application’s configuration file, and then running the application to see if anything comes up in the error log. Which command lets the user see the log file in real-time, as entries are being added?

A.tail logfile

B.tail -f logfile

C.head -50 logfile

D.more logfile

500 Chapter 16 Study Guide

9.In order to fix a bug in a process, an administrator has made changes to the daemon’s configuration file. When she checks the process, it is still exhibiting the same behavior. What is the most likely cause of the problem?

A.The file was saved with a different name

B.The process has to be restarted to enable the new configuration

C.The process needs to be reinstalled

D.The system needs to be rebooted

10.An administrator is having problem with a specific Linux distribution’s installation program. What is the best resource to use to troubleshoot the problem?

A.HOWTO networking guide

B.Linux Documentation Project home page

C.Local Linux users group

D.The distribution’s Web page

11.What is the best source of information for local Linux concerns within a Linux administrator’s geographic region?

A.Linux Users Group

B.Mailing List

C.Usenet group

D.MAN pages

12.A Linux administrator is trying to read through a large log file using the cat command. Because it is so large, the cat command scrolls the file right to the end without allowing the start of the file to be read. What command can be used to more easily read the file?

A.Use head to read the first ten lines of the log

B.Pipe the cat command to the head command

C.Copy the output to another file

D.Pipe the cat command to the more command

13.A user is complaining that he can’t connect to the company’s Web server. You have checked that the Web service is running and no one else is having problems connecting to the server. What is the most likely cause of the problem?

A.The server needs to be restarted

B.The httpd daemon needs to be stopped then started

C.The user is not using their program correctly

D.The Web server configuration is flawed

Chapter 16 Study Guide 501

14.When troubleshooting a problem, what should be an initial step in narrowing down the issue?

A.Examine if the problem is hardware or software related

B.Determine if the problem persists when the server is rebooted

C.Determine the time of day the issue occurred

D.Determine if other servers exhibit the same behavior

15.A user is complaining that the printing service is not working. What is the quickest way to check whether the service is indeed running or not?

A.Restart the server

B.Check the running processes with the ps command

C.Have the user log out then in again

D.grep the main log file for printer errors

16.What command should be used to show the first 100 lines of a file?

A.grep -100 filename

B.head -100 filename

C.tail -100 filename

D.tail -f filename

17.A Linux administrator is currently examining a problem involving a user who is unable to login. After checking the appropriate services and examining the user’s account properties, a problem can’t be found. What is the most likely cause of the issue?

A.The user’s password is expired

B.The login process is not available

C.The user is locked out of their account

D.The user’s caps lock key is on

18.A Linux administrator is trying to set up networking on a new system, but is running into problems. What is the best source of troubleshooting information in this case?

A.Networking HOWTO

B.MAN pages

C.Mailing List

D.Linux Users Group

Соседние файлы в предмете Операционные системы