456 pág.


DisciplinaLinux714 materiais1.847 seguidores
Pré-visualização50 páginas
configure and enable
kdb on your system as well as some practical commands that most Linux users
can use without being a kernel expert. For example, this chapter shows you
how to find out what a process is doing from within the kernel, which can be
particularly useful if the process is hung and not killable.
Chapter 9 is a detailed, head-on look at Executable and Linking Format
(ELF). The details behind ELF are often ignored or just assumed to work. This
is really unfortunate because a thorough understanding of ELF can lead to a
whole new world of debugging techniques. This chapter covers intimate but
practical details of the underlying ELF file format as well as tips and tricks
that few people know. There is even sample code and step-by-step instructions
xx Preface
for how to override functions using LD_PRELOAD and how to use the global
offset table and the GDB debugger to intercept functions manually and redirect
them to debug versions.
Appendix A is a toolbox that outlines the most useful tools, facilities, and
files on Linux. For each tool, there is a description of when it is useful and
where to get the latest copy.
Appendix B includes a production-ready data collection script that is
especially useful for mission-critical systems or those who remotely support
customers on Linux. The data collection script alone can save many hours or
even days for debugging a remote problem.
Note: The source code used in this book can be found at http://
Note: A code continuation character, \u27a5, appears at the beginning
of code lines that have wrapped down from the line above it.
Lastly, as we wrote this book it became clear to us that we were covering
the right information. Reviewers often commented about how they were able
to use the information immediately to solve real problems, not the problems
that may come in the future or may have happened in the past, but real problems
that people were actually struggling with when they reviewed the chapters.
We also found ourselves referring to the content of the book to help solve
problems as they came up. We hope you find it as useful as it has been to those
who have read it thus far.
This book has useful information for any Linux user but is certainly geared
more toward the Linux professional. This includes Linux power users, Linux
administrators, developers who write software for Linux, and support staff
who support products on Linux.
Readers who casually use Linux at home will benefit also, as long as they
either have a basic understanding of Linux or are at least willing to learn
more about it\u2014the latter being most important.
Ultimately, as Linux increases in popularity, there are many seasoned
experts who are facing the challenge of translating their knowledge and
experience to the Linux platform. Many are already experts with one or more
operating systems except that they lack specific knowledge about the various
command line incantations or ways to interpret their knowledge for Linux.
This book will help such experts to quickly adapt their existing skill set and
apply it effectively on Linux.
This power-packed book contains real industry experience on many topics
and very hard-to-find information. Without a doubt, it is a must have for any
developer, tester, support analyst, or anyone who uses Linux.
Anyone who has written a book will agree that it takes an enormous amount of
effort. Yes, there is a lot of work for the authors, but without the many key
people behind the scenes, writing a book would be nearly impossible. We would
like to thank all of the people who reviewed, supported, contributed, or otherwise
made this book possible.
First, we would like to thank the reviewers for their time, patience, and
valuable feedback. Besides the typos, grammatical errors, and technical
omissions, in many cases the reviewers allowed us to see other vantage points,
which in turn helped to make the content more well-rounded and complete. In
particular, we would like to thank Richard Moore, for reviewing the technical
content of many chapters; Robert Haskins, for being so thorough with his
reviews and comments; Mel Gorman, for his valuable feedback on the ELF
(Executable and Linking Format) chapter; Scott Dier, for his many valuable
comments; Jan Kritter, for reviewing pretty much the entire book; and Joyce
Coleman, Ananth Narayan, Pascale Stephenson, Ben Elliston, Hien Nguyen,
Jim Keniston, as well as the IBM Linux Technology Center, for their valuable
feedback. We would also like to thank the excellent engineers from SUSE for
helping to answer many deep technical questions, especially Andi Kleen, Frank
Balzer, and Michael Matz.
We would especially like to thank our wives and families for the support,
encouragement, and giving us the time to work on this project. Without their
support, this book would have never gotten past the casual conversation we
had about possibly writing one many months ago. We truly appreciate the
sacrifices that they have made to allow us to finish this book.
Last of all, we would like to thank the Open Source Community as a
whole. The open source movement is a truly remarkable phenomenon that has
and will continue to raise the bar for computing at home or for commercial
environments. Our thanks to the Open Source Community is not specifically
for this book but rather for their tireless dedication and technical prowess that
make Linux and all open source products a reality. It is our hope that the
content in this book will encourage others to adopt, use or support open source
products and of course Linux. Every little bit helps.
Thanks for reading this book.
xxii Preface
The history and evolution of the Linux operating system is fascinating and
certainly still being written with new twists popping up all the time. Linux
itself comprises only the kernel of the whole operating system. Granted, this is
the single most important part, but everything else surrounding the Linux
kernel is made up mostly of GNU free software. There are two major things
that GNU software and the Linux kernel have in common. The first is that the
source code for both is freely accessible. The second is that they have been
developed and continue to be developed by many thousands of volunteers
throughout the world, all connecting and sharing ideas and work through the
Internet. Many refer to this collaboration of people and resources as the Open
Source Community.
The Open Source Community is much like a distributed development
team with skills and experience spanning many different areas of computer
science. The source code that is written by the Open Source Community is
available for anyone and everyone to see. Not only can this make problem
determination easier, having such a large and diverse group of people looking
at the code can reduce the number of defects and improve the security of the
source code. Open source software is open to innovations as much as criticism,
both helping to improve the quality and functionality of the software.
One of the most common concerns about adopting Linux is service and
support. However, Linux has the Open Source Community, a wide range of
freely available problem determination tools, the source code, and the Internet
itself as a source of information including numerous sites and newsgroups
dedicated to Linux. It is important for every Linux user to understand the
resources and tools that are available to help them diagnose problems. That is
the purpose of this book. It is not intended to be a replacement to a support
contract, nor does it require one. If you have one, this book is an enhancement
that will be sure to help you make the most of your existing support contract.
Best Practices and Initial
Your boss is screaming,