Team LiB
Previous Section Next Section

Troubleshooting Tips and Tools

This section provides an overview of some of the most common troubleshooting packages used in Debian. Since one of the biggest parts of an administrator's job is knowing the right tool to use for the job, you may find yourself making your own list of "essential packages" for easy reference.

When Moving From Fedora or Red Hat

Earlier in this appendix, I described the most confusing aspects of Debian, at least for those readers who are moving from Fedora or Red Hat. Here's a refresher:

  • Use dpkg -L to find files-especially configuration files. Some will be in different places on Debian when compared to Fedora or Red Hat.

  • /usr/share/doc/packagename/README.Debian (sometimes with an added .gz extension) should be the first thing you check when you run into a problem with a given package.

  • Always install packages via apt-get. Don't download a random package file from the Web; it will likely break your system badly.

  • When in doubt, ask somebody who is more familiar with the system than yourself. The "Getting Help" section of this appendix will give you a good walkthrough of, well, getting help. Debian is not only a software distribution, it's also a rich community. Don't shun the community around Debian, as it's one of the most powerful tools available to you.

Troubleshooting Tools

Aside from the simple pointers above, you'll mainly be working with the same software, diagnosing the same problems, and using the same tools as with Fedora or Red Hat. In my experience, the hardest part of any transition is just learning which packages provide which troubleshooting facilities (remember that with Debian, all you need to know is a package's name). So the following tables offer lists of package names with descriptions and tips on further documentation, just to get you started on your transition. Table C-2 covers file system tools; Table C-3 lists network tools; Table C-4 addressed system integrity tools; and Table C-5 offers debugging tools. Unless otherwise specified, full man pages for all the commands are included in the package.

Table C-2: File System Tools

Package Name

Relevant Commands

Description

e2fsprogs

fsck.ext2, fsck.ext3, mkfs.ext2, mkfs.ext3, resize2fs, tune2fs

Standard utilities for working with ext2 and ext3 filesystems. Of particular note is the resize2fs utility, which allows you to resize an unmounted ext2 or ext3 filesystem.

xfsprogs

mkfs.xfs, fsck.xfs, xfs_repair, xfs_growfs

These are the standard utilities for working with an XFS filesystem. xfs_growfs allows you to expand the size of an XFS filesystem while it's in-use (shrinking is not possible at all). xfs_repair can only be used on an unmounted XFS filesystem.

xfsdump

xfs_fsr

Among other commands, this package includes xfs_fsr- the defragmenter for the XFS filesystem.

reiserfsprogs

mkreiserfs, resize_reiserfs

The reiserfsprogs package includes the standard utilities for working with ReiserFS filesystems-including mkreiserfs (to create such filesystems), and resize_reiserfs (to resize such filesystems).

util-linux

fdisk, cfdisk

fdisk is the traditional filesystem partitioning utility, while cfdisk is a full-screen version which provides for a more pleasant experience.

parted

parted

parted is a newer partitioning utility, and is quite good. It's also capable of resizing many filesystems and partitions. Basic manual pages are provided in the parted package, while full documentation is contained in the parted-doc package.

Table C-3: Network Tools

Package Name

Relevant Commands

Description

iputils-tracepath

tracepath, tracepath6

iputils-tracepath contains modern versions of the venerable traceroute commands. They allow you to view the route any of your Internet packets take on the way to their destination. tracepath6 is IPv6-compatible.

iputils-ping

ping, ping6

Modern versions of the ping command. ping6 includes IPv6 support.

tcptraceroute

tcptraceroute

Similar to tracepath, tcptraceroute allows you to view the route your Internet packets take on the way to their destination. Unlike tracepath, tcptraceroute uses TCP, which allows it to circumvent misconfigured routers.

mtr-tiny

mtr

mtr is an excellent tool for diagnosing connectivity problems at a distance. It is similar to tracepath and traceroute in that it examines each step on a packet's journey, but it's different in that it collects a great deal of statistics and presents them in an organized manner.

monit

monit

monit is a "hearbeat" system. It allows you to monitor your computers and the services running on them in an automated manner. It allows for numerous reporting methods, including pages and e-mail. Documentation for monit is contained in /usr/share/doc/monit/.

netcat, netcat6

nc, nc6

netcat is a versatile tool for network analysis, whose full capabilities can't even be touched here. It's often referred to as "the Swiss Army knife of networking."

ssh

ssh, sshd

The Debian ssh package contains both the OpenSSH client and server. OpenSSH is a secure remote-login protocol that allows for unattended non-interactive logins.

telnet-ssl

telnet

While telnet's usage as a remote login protocol has been diminished in recent years (namely falling due to the convenience of SSH), it's still useful to talk to a network server "in the raw."

dnsutils

dig, nslookup

dnsutils contains dig and nslookup, two stalwart utilities used commonly in diagnosing Domain Name System problems.

openssl

openssl

The openssl package provides a command-line interface to the OpenSSL libraries, which export a large number of cryptographic-related functions.

Table C-4: System Integrity Tools

Package Name

Relevant Commands

Description

aide

aide

AIDE stands for "advanced intrusion detection environment." It keeps track of any changes to files on your system, and will notify you if something has changed when it shouldn't have. It can be difficult to set up and maintain, but the results are quite worth it. Man pages, as well as documentation in /usr/share/doc/aide/.

chkrootkit

chkrootkit

chkrootkit performs some rudimentary tests to check to see if a root kit has been installed on your Debian installation. A root kit is used by malicious crackers to maintain control over an installation they have cracked into.

checksecurity

checksecurity

checksecurity runs automatically each day and will notify you of any changes in setuidor setgid applications. setuid and setgid applications are those which always run with elevated user privileges, regardless of the user who actually runs them.

debsums

debsums

Many Debian packages include cryptographic "hashes" of files that allow one to identify whether a file has been changed since it was installed. debsums is a utility to ensure that no files have been changed. Be warned, though-if an intruder is able to change a file that came from a package, they're also able to change the database of cryptographic hashes. debsums can be thought of as an easy-to-use version of AIDE. (Note: this package is Debian-specific, unlike the others listed in these tables.)

tar

tar

tar is a venerable backup utility, which archives multiple files into a single, optionally compressed file. It can be difficult to use, but its archives are usable on pretty much any modern platform (and several obsolete platforms).

rsync

rsync

rsync is a file-transfer application which allows you to transfer sets of files between two machines. Even more impressive, however, is its ability to keep those two repositories synchronized-it implements a very efficient transfer algorithm which only transfers those parts of the files which have changed.

amanda-client, amanda-server

Too many to list.

Amanda is a popular client/server backup solution that works over a network. Documentation is available via man pages, /usr/share/doc/amanda-client/, and /usr/share/doc/amanda-server/.

duplicity

duplicity

duplicity is a flexible and secure backup/archiving solution. It supports encryption and incremental backups. It uses the same partial-change algorithm as rsync, meaning incremental backups are quite small in size.

Table C-5: Debugging Tools

Package Name

Relevant Commands

Description

strace

strace

strace allows you to monitor the internal workings of an application. This is particularly useful when the application fails to function but doesn't provide a helpful error message.

Itrace

Itrace

Itrace is similar to strace, but instead of intercepting system calls it intercepts library calls.

gdb

gdb

gdb is the GNU Debugger. It's a very complex debugger used to closely analyze, interactively, the inner workings of an application. It's primarily useful to developers, as knowledge of the application's source code is required, gdb documentation is in texinfo format, contained in the package. To view it, install the info package and then run info gdb.

ddd

ddd

ddd stands for Data Display Debugger. It's a graphical front-end to gdb. ddd documentation is in texinfo format, contained in the package. To view it, install the info package and then run info ddd.


Team LiB
Previous Section Next Section