Essential System Administration, 3rd Edition
leen Frisch
Copyright 2009 O'Reilly Media, Inc.
O'Reilly Media
Dedication
For Frank Willison
"Part of the problem is passive-aggressive behavior, my pet peeve and bte noire, and I don't like it either. Everyone should get off their high horse, particularly if that horse is my bte noire. We all have pressures on us, and nobody's pressure is more important than anyone else's."
***
"Thanks also for not lending others your O'Reilly books. Let others buy them. Buyers respect their books. You seem to recognize that `lend' and `lose' are synonyms where books are concerned. If I had been prudent like you, I would still have Volume 3 (Cats-Dorc) of the Encyclopedia Britannica."
Preface
This book is an agglomeration of lean-tos and annexes and there is no knowing how big the next addition will be, or where it will be put. At any point, I can call the book finished or unfinished.
Alexander Solzhenitsyn
A poem is never finished, only abandoned.
Paul Valery
This book covers the fundamental and essential tasks of Unix system administration. Although it includes information designed for people new to system administration, its contents extend well beyond the basics. The primary goal of this book is to make system administration on Unix systems straightforward; it does so by providing you with exactly the information you need. As I see it, this means finding a middle ground between a general overview that is too simple to be of much use to anyone but a complete novice, and a slog through all the obscurities and eccentricities that only a fanatic could love (some books actually suffer from both these conditions at the same time). In other words, I won't leave you hanging when the first complication arrives, and I also won't make you wade through a lot of extraneous information to find what actually matters.
This book approaches system administration from a task-oriented perspective, so it is organized around various facets of the system administrator's job, rather than around the features of the Unix operating system, or the workings of the hardware subsystems in a typical system, or some designated group of administrative commands. These are the raw materials and tools of system administration, but an effective administrator has to know when and how to apply and deploy them. You need to have the ability, for example, to move from a user's complaint ("This job only needs 10 minutes of CPU time, but it takes it three hours to get it!") through a diagnosis of the problem ("The system is thrashing because there isn't enough swap space"), to the particular command that will solve it (swap
or swapon
). Accordingly, this book covers all facets of Unix system administration: the general concepts, underlying structure, and guiding assumptions that define the Unix environment, as well as the commands, procedures, strategies, and policies essential to success as a system administrator. It will talk about all the usual administrative tools that Unix provides and also how to use them more smartly and efficiently.
Naturally, some of this information will constitute advice about system administration; I won't be shy about letting you know what my opinion is. But I'm actually much more interested in giving you the information you need to make informed decisions for your own situation than in providing a single, univocal view of the "right way" to administer a Unix system. It's more important that you know what the issues are concerning, say, system backups, than that you adopt anyone's specific philosophy or scheme. When you are familiar with the problem and the potential approaches to it, you'll be in a position to decide for yourself what's right for your system.
Although this book will be useful to anyone who takes care of a Unix system, I have also included some material designed especially for system administration professionals. Another way that this book covers essential system administration is that it tries to convey the essence of what system administration is, as well as a way of approaching it when it is your job or a significant part thereof. This encompasses intangibles such as system administration as a profession, professionalism (not the same thing), human and humane factors inherent in system administration, and its relationship to the world at large. When such issues are directly relevant to the primary, technical content of the book, I mention them. In addition, I've included other information of this sort in special sidebars (the first one comes later in this Preface). They are designed to be informative and thought-provoking and are, on occasion, deliberately provocative.
The Unix Universe
More and more, people find themselves taking care of multiple computers, often from more than one manufacturer; it's quite rare to find a system administrator who is responsible for only one system (unless he has other, unrelated duties as well). While Unix is widely lauded in marketing brochures as the "standard" operating system "from microcomputers to supercomputers"and I must confess to having written a few of those brochures myselfthis is not at all the same as there being a "standard" Unix.At this point, Unix is hopelessly plural, and nowhere is this plurality more evident than in system administration. Before going on to discuss how this book addresses that fact, let's take a brief look at how things got to be the way they are now.
attempts to capture the main flow of Unix development. It illustrates a simplified Unix genealogy, with an emphasis on influences and family relationships (albeit Faulknerian ones) rather than on strict chronology and historical accuracy. It traces the major lines of descent from an arbitrary point in time: Unix Version 6 in 1975 (note that the dates in the diagram refer to the earliest manifestation of each version). Over time, two distinct flavors (strains) of Unix emerged from its beginnings at AT&T Bell Laboratorieswhich I'll refer to as System V and BSDbut there was also considerable cross-influence between them (in fact, a more detailed diagram would indicate this even more clearly).
Figure P-1. Unix genealogy (simplified)
Note
For a Unix family tree at the other extreme of detail, see http://perso.wanadoo.fr/levenez/unix/. Also, the opening chapters of Life with UNIX, by Don Libes and Sandy Ressler (PTR Prentice Hall), give a very entertaining overview of the history of Unix. For a more detailed written history, see A Quarter Century of UNIX by Peter Salus (Addison-Wesley).
The split we see today between System V and BSD occurred after Version 6.[] developers at the University of California, Berkeley, extended Unix in many ways, adding virtual memory support, the C shell, job control, and TCP/IP networking, to name just a few. Some of these contributions were merged into the AT&T code lines at various points.
System V Release 4 was often described as a merger of the System V and BSD lines, but this is not quite accurate. It incorporated the most important features of BSD (and SunOS) into System V. The union was a marriage and not a merger, however, with some but not all characteristics from each parent dominant in the offspring (as well as a few whose origins no one is quite sure of).