ltrace and the -f flag

Debugging running programs under linux can be extremely simple. The program ltrace allows you to watch all the library calls being made which helps locate where a program is going wrong. It can also allow you to notice some basic performance bottlenecks.

The -f flag is also particularly useful for watching a servers progress, and in particular a daemon that crashes. The typical method of initialisation for a daemon is to fork off, stop responding to various signals and then in the new process do the actual initialisation. If the daemon decides to terminate in the usual verbose unix fashion then you have a problem. Using the -f flag means that ltrace also monitors all the processes created by forking and allows you to see what actually caused it to finish.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s