13.07.2015 Views

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 11 ■ TRACKING DOWN BUGSThe rest of this chapter discusses some useful tools and strategies for bug fixing. My final noteon the matter of saving time is that sometimes the quickest way to solve a problem is to step back fromit for a while. Make a cup of tea, go for a walk around the block, or go play NetHack for a few minutes(preferably not for the whole day...); just do anything that gives you a little mental space from theproblem. Several times I’ve been hit by the solution for a particularly nasty bug while cycling homefrom work and concentrating on the traffic rather than on the problem. It’s possible to focus so hardon an issue that you can’t see a valuable but slightly sideways solution to it. Giving your subconscioussome time to chew on things can be incredibly helpful and save you hours of banging your head againstthe desk.11-2. Knowing What to Check FirstHere’s a quick list of things to check for any bug before you start doing any serious problem solving:• Run df -h: Are any of the disks full? / or /var in particular can cause peculiarproblems, but the /home partition filling up can also give rise to errors (as can/tmp).■ Note Sometimes a process may create a large log file that is then deleted but not closed by the process, so itremains there until the process drops it (in other words, the disk space won’t actually be released). If you think thismight have happened, you can use lsof to take a look:lsof | grep /varThis will show you any files that are open in the /var/ directories. Here’s an example:innd 3360 news mem REG 254,6 155656 2129922 /var/spool/news/overview/group.indexmutt 26671 juliet 3r REG 254,1 2694918 1425422 /var/mail/julietThe seventh column shows the file size, and the second column shows the PID of the process. If you find adubious entry, you can try restarting the relevant process to clear the file properly.• Run ifconfig: Check that the network interface still has a correct-looking addressand hasn’t taken itself down.• Run ping gateway; ping nfs.example.com; ping ldap.example.com; pingkerberos.example.com; ping machine.external.com: Check that all your localservers are still contactable and then that the outside world is contactable.215Download at WoweBook.Com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!