Thursday, January 29, 2009

UNIX Utilities for debugging

For quite sometime I am working on IBM Tivoli Access Manager installed on AIX and Solaris servers. Very often I run into issues and over the time have learned few UNIX commands which are very helpful while debugging issues.

  1. truss: It displays calls made to system libraries by the program you are running.
    truss -fae -xall -rall -vall -wall -o /{somewhere}/truss.out ./scriptname
    When you try to start a process let say pdmgrd (TAM policy server) and it fails to start, running the truss helps you find out if there was issue while loading any library or some other file.

  2. coredump: contains the runtime information for a program that crashed or stops abnormally. It could be helpful to analyse the issue. On a solaris box current configuration can be viewed using 'coreadm' command.
    Per process core dump can be enabled with
    coreadm -e process
    Usually coredump file is created in same folder where process is running.
    It is necessary that user who own the process has desired permission to create the coredump. It can be verified with below command:
    ulimit -a

  3. find a string in list of files
    find . -name "*.properties" -exec grep -i "staring to find" '{}' \; -print
    Above command search for the specified string in all the files satisfying the expression.

  4. ldd: prints out dependencies and shared libraries required by the program. It is helpful to find out if program is failing to load a required library.

  5. systemdef: it prints out system information like devices, version, loadable modules.

  6. dispkdb: it prints out details of a certificate (kdb file) like label, dn, issued on, expires on etc. In WebSEAL when a server side certificate expires, it does not provide response to HTTPS request and shows "page can not be displayed" in browser. This command can be run as below
    /opt/PolicyDirector/sbin/dispkdb -f cert.kdb



For more details on these commands you can google around but this can atleast give you a little start. Happy debugging.[:D]

3 comments: