SUMMARY: Debugging process in Unix

From: Dirk Moolman (DirkM_at_mxgroup.co.za)
Date: 04/29/05

  • Next message: jason kappy: "netout: Broken pipe/ rcp lost connection/ Netbackup Restore fails."
    Date: Fri, 29 Apr 2005 14:17:59 +0200
    To: <sunmanagers@sunmanagers.org>
    
    

    Thanks everyone. Again I had lots of replies, and I will copy the the
    most complete answers below:

    [Ric Anderson]

    There are many
            truss -p pid
    shows what system calls a process is making.

            ps -fp pid
    shows general status

            pldd pid
    shows what dynamic libraries (.so) files a process is using.

    In addition, there are a number of tools in /usr/proc/bin
    that let you look at the actions of a process.

    If you have lsof installed, then
            lsof -p pid
    will show open files for a process.

    Some debuggers (e.g., gdb) can also be used with a pid
    to interactively debug a running process.

    [Jonathan Birchall]

    It all depends on how deep you wish to go and what version of Solaris
    you are using.

    Truss -wall -vall -fall -o<outputfilename> -p <PID> will give you
    details of system calls etc. see Man truss

    You can also use the p commands see man pfiles , ptree , pmap etc.

    In Solaris 10 you can also now use dtrace for a detailed view of what
    the process is doing.

    Using a mixture of the about should give you a fairly detailed view of
    what is happening.

    You can also use adb (debugger).... which also pointed me to mdb
    (solaris 9)

    With Ric's help, using lsof, we managed to track down the problem.

    [ORIGINAL POST]

    > -----Original Message-----
    > From: sunmanagers-bounces@sunmanagers.org
    > [mailto:sunmanagers-bounces@sunmanagers.org] On Behalf Of Dirk Moolman
    > Sent: Friday, April 29, 2005 12:27 AM
    > To: sunmanagers@sunmanagers.org
    > Subject: Debugging process in Unix
    >
    >
    > What is the command to see what a process is doing in Unix ? I know
    > there is a command that you type in with the PID, and it show you
    > exactly what that process is doing.
    > _______________________________________________
    > sunmanagers mailing list
    > sunmanagers@sunmanagers.org
    > http://www.sunmanagers.org/mailman/listinfo/sunmanagers
    _______________________________________________
    sunmanagers mailing list
    sunmanagers@sunmanagers.org
    http://www.sunmanagers.org/mailman/listinfo/sunmanagers


  • Next message: jason kappy: "netout: Broken pipe/ rcp lost connection/ Netbackup Restore fails."

    Relevant Pages

    • Re: user ip
      ... >> Depending on what version of unix you're running you can probably get ... >> it from the who command. ... On Solaris, ...
      (comp.unix.shell)
    • Re: anyone have software to OCR a PDF?
      ... for me to remember the command name... ... I just knocked up a script on UNIX (Solaris 10) to give a frequency ...
      (comp.sys.apple2)
    • Re: Route Add: Where to save?
      ... Welcome to Unix. ... when I manually submit this command on ... it is a text config file. ... With a single nic on the Solaris box, ...
      (comp.unix.solaris)
    • Re: Command to find subnet mask on Unix machine
      ... > Can anyone please tell me the command to find Subnet mask of the Unix ... > machine both Solaris and HP_UX ...
      (comp.unix.shell)
    • Re: How to Compare Unix PID list with database data list?
      ... do anything with $pid, ... I need to write a shell script that need to get the PID list from unix ... server and also i need to do a select in database table that have the ... command is highly depending on the type of Unix system you are on). ...
      (comp.unix.shell)