partially created files before trying again. The make clean command will clean up
after a failed or successful make attempt.
• make install—this portion of the make process is used to move the produced execut-
able and supporting files to their destination folders such as /bin, /sbin, /usr/bin, and
/usr/sbin.
• make tar—some makefiles contain a portion that allows you to package the result of
the compilation process into a single file.
• rpm—the Red Hat package manager command-line program that can install soft-
ware from an RPM file.
• tar—the tape archive program used to package together and unpackage files and
directories. While it is used for backup purposes, it is commonly used by the open
source community to create software packages for easy transport over the Internet.
Software Installation and Maintenance
◾
569
• test—used to test if a directory or file already exists.
• yum—the Yellowdog Updater, Manager is a front-end tool for rpm so that the user
has a minimal amount to issue when trying to install RPM files. yum, unlike rpm,
will track down and install dependent packages.
REVIEW QUESTIONS
1. Before installing software, what questions should you ask about your organization?
What questions should you ask about your system?
2. What is a package dependence?
3. Using the Add/Remove Software tool, what happens if a dependence is found?
4. Who is allowed to install software through the Ubuntu Software Center tool?
5. What is the relationship between yum and rpm?
6. What is the RPM Fusion project?
7. What types of packages can you find at packages.debian.org?
8. An RPM file has the name mysoftware-3.1.5-2.i386.rpm. What is the version number
of this software package? What is the release number?
9. What does noarch mean when found in an RPM title?
10. What is the difference between upgrading and freshening an RPM package?
11. What happens if, when using rpm to install a package, there are dependencies that
are unmet?
12. What happens if, when using rpm to install a package, there is no digital signature?
13. What happens if, when using rpm to install a package, the digital signature is not
recognized?
14. How can you test for an RPM file’s digital signature before trying to install it?
15. What does the instruction
yum list *
do?
16. What does yum’s downgrade option do?
17. What is the difference between yum install
somesoftware
and yum -y install
somesoftware
?
18. What is the Debian equivalent to yum?
19. Why might you want to install open source software from source code rather than
an already-created executable or installation program?
20. What program will you probably need to have in your Linux system to successfully
install open source software from its source code?
570
◾
Linux with Operating System Concepts
21. Why might you want to run .
/configure
?
22. What types of options might you specify when running the configure script?
23. What is the difference between
make
and
makefile
?
24. When might you run
make clean
?
25. What is the difference between
make
and
make install
?
26. Draw a parse tree for the following C instruction:
x
=
y*z
++
;
27. Draw a parse tree for the following C instruction:
while(x
>
=
0)
x
=
x-y;
28. What does optimization mean with respect to compilation?
29. In gcc, what does
-Wall
mean?
30. Why might you use the –c option in gcc so that compilation does not include linking?
31. What is the difference between using the –o option in gcc and not using it?
32. If you were asked to produce documentation on how to use a piece of installed soft-
ware, what information might you include?
33. Which of these operating systems was produced and released entirely by the open
source community? BSD Unix, GNUs, Linux.
34. Richard Stallman has said that software should be “free as in free speech” and not
“free as in beer.” What did he mean by this?
35. What dispute exists between the Free Software Foundation and the Open Source
Initiative?
36. Examine the software titles in Table 13.3. Come up with a list of five other titles that
you or someone you know uses that are open source titles.
37. Why might a programmer contribute to the open source community?
38. Even if you are not a programmer, how could you contribute to the open source
community?
571
C h a p t e r
14
Maintaining and
Troubleshooting Linux
T
his chapter’s learning objectives are
• To understand the importance of backups and how to implement backup strategies
• To be able to use the Linux performance monitoring tools
• To utilize the scheduling programs of at, batch, and crontab
• To understand the role of log files and how to apply this information
• To understand how to perform disaster recovery planning
• To understand how to perform operating system troubleshooting
14.1 INTRODUCTION
So, you have successfully installed Linux, created accounts, mounted file systems, auto-
mated the initialization process, configured your network, and installed software. There
is nothing more to do and you can coast for the rest of your career, right? Wrong. These
steps have established Linux and given users the ability to use Linux. But this is only half
of your job.
Now, you have to maintain the system. This requires keeping tabs on system resources
to ensure that you have adequate resources for the user load. You have to monitor for exter-
nal threats over the network. You have to ensure the integrity of the data files in the system
through backups. You will also want to automate as many tasks as possible. To perform
maintenance, you will have to learn
• How to perform backups of the various file systems
• How to monitor system resources
572
◾
Linux with Operating System Concepts
• How to schedule tasks
• How to keep track of events through log files
Whenever something goes wrong, you will be the first to hear about it! Now, you need
to learn to take the next step in Linux: how to troubleshoot a system that is not running
efficiently or correctly, or is not running at all.
In this chapter, we examine four activities that are all related in that they are tasks
revolving around maintenance and troubleshooting:
• Performing backups
• Scheduling tasks
• Monitoring the system
• Reviewing log files
We also discuss disaster planning and recovery. This chapter wraps up with some trou-
bleshooting scenarios: problems, ways to discover the cause(s), and solutions.
14.2 BACKUPS AND FILE SYSTEM INTEGRITY
In Chapter 10, we introduced the tools to perform backups. Here, we examine when, why,
and how you might perform backups. Before you undertake this task, you must ask your-
self which partitions really need to be backed up.
• For /home, it depends on the number of users and how frequently they use/store files
• For /var, it depends on the software you are running; which programs store data files
in /var and how frequently is that software being used?
• For /usr, it generally depends on how often you install and remove software
• For most of the root partition (/), changes will only occur when you upgrade
the system
14.2.1 Examining File System Usage
You should determine the frequency that the particular partition should be backed up:
daily, weekly, or monthly (or even less frequently). The /home directory will be the par-
tition that requires the most frequent backups. If you have dozens (or more) users who
regularly use the system, then this file space will change daily. In such a case, daily back-
ups would not be a bad thing. Alternatively, as you may have to bring the partition down
(unmount it) to back it up, you might perform backups a few days during the week such as
every third day at midnight or every Sunday night and every Wednesday night.
If a workstation is primarily used by an individual user, weekly backups might be
more practical. An alternative approach is to use a network file server to mount all user
Maintaining and Troubleshooting Linux
◾
573
directories. Local disk storage would store the operating system and application software
along with software-based data files. This allows you to perform nightly backups of a
single, centralized location. This solution has its own detractors. First, you might need
to purchase several file servers to support the number of users. Second, file servers are
more expansive than workstations, requiring a greater investment to support this solution.
Third, you would unmount the network file system before backing it up, thus making user
home directories inaccessible during the backup period. By having several file servers and
distributing users across the file servers, you can then alternate which server is backed up
each night.
The other file systems do not need to be backed up nearly as often. The/var direc-
tory would be the next most common file system in need of backing up. As with /home,
when /var is backed up, it is best to unmount it. With log rotation, you can ensure that
there is adequate disk space. Once per week, you save the current log files and then start the
new week with new log files. After a few weeks, you back up the log files to storage, enabling
you to delete those in /var. The mail directory might tend to grow rapidly. However, you
can solve this problem by instituting a disk quota on mail log files, forcing users to regu-
larly delete or save to their home directory any important emails. Alternatively, you could
implement the mail server elsewhere and not on this Linux system at all.
14.2.2 RAID for File System Integrity
The next question to consider is why are you performing a backup? This, of course, has an
obvious answer, to protect the data in case of hard-disk problems. Additionally, you may
wish to archive old files (e.g., save log files so that they can be examined some time later).
However, there are other potential answers here that lead to differing backup strategies.
If you are attempting to secure your data, should you perform daily/weekly backups or
use some form of redundant storage? RAID storage provides you the ability to restore data
should a disk surface become unreadable. This is possible because other disks are storing
enough information to restore what has been lost. In this way, every time you save some-
thing, extra data in the form of redundancy are being saved.
There are several different forms of RAID. These are known as
Do'stlaringiz bilan baham: |