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 BUGS• Run top: Is there a process that’s chewing up all or a lot of the CPU? If so,depending on what it is, you may be able just to kill it.• Run ps -A: Are there lots of defunct processes? This can mean various things,but resolving whatever is happening may help you find what your bug is.• Run date: Check that the time is correct. Especially if you’re using Kerberos, it’simportant that the time on the local machine matches the time on the server towithin a few minutes.• Restart X: This is another in the “crude but often effective” box. Use/etc/init.d/gdm restart (if you use the GDM display manager; otherwise,replace as appropriate), or hit Ctrl-Alt-Backspace from the display.• Switch to a console (Ctrl-Alt-F1), and log in as root: Are there general login issues?This should show up if there are serious login problems.• Switch to a console (Ctrl-Alt-F1), and log in as yourself, a test user, or another user(or use su): Again, this may show up general login issues, in which case you maywant to take another look at whether your servers are up and responding.• Run iostat -dxk 5: This will give you a quick view of what the disk I/O is doing. -xgives an extended report, -d shows device utilization, -k shows KB per secondrather than bytes per second, and 5 refreshes every five seconds.11-3. Looking at diff Outputdiff is handy if you’re comparing config files from two separate machines. Copy the second file to thefirst machine (this example uses the /etc/hosts file):scp client1:/etc/hosts hosts-client1■ Note If you have SSH keys set up (see recipe 6-1), you can use this:diff /etc/hosts

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

Saved successfully!

Ooh no, something went wrong!