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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 11 ■ TRACKING DOWN BUGS• -T: Shows the time spent in library calls (that is, the time difference between thebeginning and end of each library call).• -r: Prints a relative timestamp at the start of each library call.• -c: Counts the time, calls, and errors for each library call, and summarizes thisinformation when the program exits. This is helpful if you’re debugging andyou’re not sure where to start, because it’ll help you work out where the problemmight lie.• -e CALLNAME: Traces only the specified library calls. Alternatively, -e !CALLNAMEwould trace all calls except for the specified one. You can use this to minimizethe amount of output; it may be best used after you’ve used -c to identify theproblem area.• -p PID: Attaches ltrace to the process with the specified process ID. So if yousuddenly see a process hanging or eating up lots of CPU, you can find out what it’sdoing in real time.• -S: Traces system calls as well.11-6. Logging with syslogdMany of the programs on your system will send their logging messages to syslog, which manages thelogging on most <strong>Linux</strong> systems. syslog can be configured to send particular types of log messages toparticular locations.syslog messages have two pieces of information attached to them: a facility, identifying thesource of the message, and a priority. Both of these are system-defined rather than user-defined;see Tables 11-1 and 11-2 for the available values.Table 11-1. syslog FacilitiesPriority LabelauthauthprivcrondaemonftpkernlprDescriptionAuthorization messages and information (aka security, but this is deprecated)Used for user access messagescronAny daemon that doesn’t have its own facilityFTPKernel messagesPrinter system messages223Download at WoweBook.Com

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

Saved successfully!

Ooh no, something went wrong!