Book Review: Debian 7: System Administration Best PracticesDistributed Systems with Node.js, O'Reilly 2020, has been published!
I recently read a copy of Debian 7: System Administration Best Practices, written by Rich Pinkall Pollei and published by Packt. Full disclosure: I've published a book through Packt, and they sent me a free copy of the book to do this review.
Relevant background: Debian has been my preferred distribution for a few years, with
apt-get being the package management system I'm most familiar with. My website, as well as several others I control, are hosted on a Debian 7 Linode VPS, and I perform all maintenance via SSH. Even my current development machine is running Linux Mint, which is Debian under the hood.
This book is an ambitious attempt to cover many facets of Debian Linux sysadmin within the confines of 100 pages. There is a lot of material to cover, and the 100 pages of this book falls a bit short (on several occasions the author mentions a touched-upon topic as being outside the scope of the book). The ideal audience is a narrow set of intermediate users, perhaps having used Linux for at least one year and no more than two years. While some of the information is catered towards beginners, such as the overview of Linux in the beginning and different filesystems, much of the content requires intermediate knowledge of Linux.
In the later sections of the book, the focus switches slightly to the LAMP stack, with Apache, PHP, and some commonly used tools for headless web server administration. I'll be honest, when I picked up the book I assumed it was on the topic of server administration, but with earlier sections covering desktop-focused topics such as full-disk encryption as well as Window Managers, the book covers the full gamut of Debian environments.
The first chapter, Debian Basics for Administrators, is a short history and overview of Linux and how Debian fits within the Linux ecosystem. While this chapter doesn't contain any information which would warrant the for Administrators part of the title, it is good information for anyone running a Linux-based Operating System.
I found the section on Filesystems much appreciated. While the default FS selection presented during installation is usually fine for most installations, as a beginner it's easy to get caught up and wonder what the differences are.
Considering the brevity of the book, there is a decent amount of information provided on the concept of Disk Encryption, a topic many books on this subject would have left out. In light of recent government surveillance revelations this topic is quite worthy of being covered by more books.
The book overall is a quick read, one which the user can get through in a dedicated afternoon (I read my copy over a few hours yesterday). Plenty of the topics are high-level, and don't necessarily get the readers hands too dirty.
The Package Management section covers the basics of
dpkg, and mentions a tool called Alien for installing non-Debian packages. There's even a sub-section on performing manual builds of software. While it's nice to cover these tools, I've personally never had to use Alien,
apt-get being 95% of package management I do, and building from source being the last 5%.
Considering the audience, I would like to have seen the author guide the reader through an actual build process they may encounter in the wild. For example:
<code>sudo apt-get install build-essential wget http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz tar -zxvf node-v0.10.24.tar.gz cd node-v0.10.24 ./configure make sudo make install
Many topics are mentioned, which requires intermediary knowledge of Linux, but a quick explanation could have made the topic digestible by beginners. For example, on page 24, the author talks about the swap partition, and how it is used for paging memory to disk. What does paging memory mean? By rewording this into saying “If the computer runs out of RAM, which it might have about 8GB of, it can temporarily store data into the slower hard drive, which may be 1TB.”, the audience is much larger.
On page 43, the author mentions config files having been changed between the package maintainers version and the sysadmin's version, and how there are tools for showing diffs and choosing which version to go with. I would like to have seen more emphasis on this section, as it is the biggest cause of a nuked Debian installation (for me personally, that is).
Also on page 43, the author mentions how PHP can change and how “re-coding web pages” may need to occur. While much of the software has automatic dependency checking, like phpMyAdmin installed via apt-get, scripts installed by a user will be unaware of said version change and can break. A bigger distinction on this would have been beneficial for many a beginner.
On page 53 the author talks about services and how to control and configure them. As an example, he covers Apache 2 to some length. However, he covers Apache 2-only commands such as
apace2ctl. While it is nice that the author chose a service which exemplifies the many different configuration options Debian services have (config includes, -enabled vs -available), I really wish he would have covered the build in
service command which can be applied to all services (e.g.
sudo service mysql restart). The
service command also could have been covered in the System Management chapter when talking about init scripts.
The topic of Linux Clusters is mentioned a few times throughout the book, but it feels artificial, and after reading the book, I am no closer to understanding how to build my own Linux Cluster.
On page 43, the reader is told that they can read email sent to the root mail account to get information about upgrade notes. It would be great if the author covered how to do this (e.g.
Also on page 43, in the After the Upgrade section, a nice tip for the reader would be to reboot their machine if it is a development machine. I've often found myself rebooting a Linux laptop weeks after I've run a few upgrades, only to find X Windows not starting, and wishing I had done it sooner while the changes were still fresh in my mind.
On page 41, the author tells the reader to read the Debian release notes, but doesn't mention where to find them.
bum commands mentioned on page 60 exist on my Mint Linux laptop nor my headless Debian 7 server. I looked into it some, and one must first
sudo apt-get install sysv-rc-conf to get those programs. The same goes for the
parted command mentioned on page 67. Whenever covering a command which doesn't exist in the base-installation, installation of said programs should be mentioned beforehand.
The System Management > Filesystem section on page 66 might have been better merged into the Filesystem Layout chapter.
On page 80 the author mentions editing the
/etc/sudoers file for giving users the ability to run
sudo. However, the preferred “safe” method for editing this file is by using the
visudo command (which is even mentioned within the file). This command provides syntax checking and does file locking, and provides other niceties.
The Ugly, AKA, Errata and Nit-Picking
Page 10: “leading-edge” should be “bleeding edge”.
apt-get <strong>dist-upgrade</strong> and
aptitude <strong>full-upgrade</strong> could have been highlighted as code entirely, but that's a matter of opinion considering the context.
Page 52: The image of text would have been better served by using text. The config parent/children relationship seems off due to how config files are loaded.
Page 53: There are two spaces instead of one in “These are the files that are part of”.
Page 53: Could have mentioned that normal files in sites-enabled, which aren't symlink'd to sites-available, still load as normal.
Page 63: The text says the interfaces file was generated automatically, but I was under the impression Debian only auto generates DHCP interfaces (it is displayed as static).
Page 67: The note that EXT4 is 2-20 times faster than EXT3 for FSCK would be good to know in the earlier Filesystem chapter when selecting a Filesystem.
Page 68: The paragraph at the bottom beginning with “Note” would have been a good candidate for the bracketed “note” paragraph style.
Page 68 & 69: The notes about gparted and live systems seems redundant with each other.
Page 71: The tangent about a NAS device introduces many new concepts and may leave the reader confused.
Page 74: The phrase “Straight servers” is unfamiliar to me; perhaps “Headless servers” would have been better?
Page 74: The claim that European users prefer KDE and Americans prefer Gnome should have a citation.
Page 74: The term “home sites” should be “websites”.
Page 75: The
<strong>gdm3</strong>setup command needs to be entirely highlighted as code.
Page 75: The note at the bottom of the page should be clarified by stating Linus Torvalds is the creator of Linux.
Page 79: The tip at the bottom of the page should say root account password, not root account login. It's still possible to become the root user, the account just doesn't have a password which can be used for login (e.g. run
sudo su and you're root).
Page 96: The Installing Webmin file content should be bold, and the second line is missing the trailing backslash.
Page 98: The comment on using Webmin to make changes, then manually checking the file to make sure the configuration is legit, leaves the reader wondering why they would want to use Webmin at all.