Pkgapp 3.0 code has been finalized!

Pkgapp3 is the latest update to the Sun GDD tool set. These tools are designed to help customers gather the data needed for the best possible support on their issues.

Pkgapp is a shell tool built by Sun Support Engineering to help gather all OS and application libraries used by Sun Java Systems (and others) servers at runtime.  Pkgapp can be used to gather these libs, etc, from cores produced by crashes or gcores captured manually by administrators.

Pkgapp is part of the GDD (Gathering Debug Data) suite of tools and has been used for years to help Sun Support debug tricky crashes, as well as performance and memory leak problems where cores or gcores are available.

New major features in Pkgapp 3.0:

1) Now handles Java Cores and grabs jstack and jinfo.
 - See the -j and -J options

2) Includes all functionality that was available in both pkg_app 2.7 and pkgcore.

3) Can allow for the temporary files to be retained in /tmp
 - See the -r option

4) Allows pkgapp3 to be placed in a $PATH location; can now be run from any location.

5) Can use relative paths for the following options:
 -c <core file OR pid of a running process>
 -p <full path to, but not including the process binary> (ns-slapd, imapd, httpd etc.)
 -s <Storage; path to store the final tar file in>

6) Retains all lib/binary paths (pkgcore) as well as the pkg_app app/ location for older pkg_app aware applications.

7) Names the final storage path as pkgapp-<date>-<index> to help administrators locate the final tar file faster.
 - Ex: pkgapp3-111708-01/

8) Gathers the following Solaris only proctool commands from the core.
 - pldd
 - pstack
 - pmap
 - pcred
 - pflags
 - pargs

9) Checks to see if the core file is truncated and checks the core files cksum to ensure the file size match.

10) Gathers the following core and pkgapp3 specific data
 - core file cksum
 - core file truncation (good/bad)
 - core file size (ls -l)
 - library list (from the pldd)
 - manifest log (all files included int he final tar)
 - pkgapp3 arguments used.

11) Gathers the following OS specific data
 - coreadm info
 - date/time
 - messages (from /var/adm)
 - pkginfo
 - showrev -p
 - /etc/release (Solaris)
 - ulimit
 - uname -a

12) Creates a script to allow Sun Engineers to quickly run "coreinfo" for ns-slapd processes (only).

13) Alerts administrators they must upload 2 files (pkgapp tar & core) separately when they do not use the -i (include core) switch.

14) Will exit with a fatal error if a pldd cannot be properly retrieved from the core and alerts the administrator to run pkgapp3 using a pid as the -c option.

15) Saves the pkgapp3 arguments and runtime log into /var/tmp/pkgapp-history/.  Helps administrators and pkgapp see previous runs.

16) Updated usage and alert messages.

 Here are a couple previews of how the new code works.

 Example: Usage output

\* ----------------------------------------------------------------------------------
\* Sun Microsystems RSD pkgapp 3.0 Solaris                               [11/24/2008]
\* ----------------------------------------------------------------------------------
pkgapp 3.0, a Sun Microsystems data gathering utility.
  pkgapp [options] -c <core file | pid> -p <full path (path only) to process binary> -s [path to write tar file]

Required parameters:
 -c <core file OR pid of a running process>
 -p <full path to, but not including the process binary> (ns-slapd, imapd, httpd etc.)

Optional parameters:
 -i (Include a previously generated core file with the final tar.gz)
 -j (Javacore; process a java core)
 -r (Remove all temp files)
 -q (Quiet)
 -d (Debug)
 -J <JstackPath; path to the jstack (jdk) commands>
        defaults to /usr/jdk/instances/...
 -s <Storage; path to store the final tar file in>

usage:  pkgapp -c <name of the core file> -p <path to process binary>
usage:  pkgapp -c <pid of the running app> -p <path to process binary>

Examples: these are examples mixing various parameters

Directory Server
pkgapp -i -r -c ./core.14740 -p /var/mps/ds52p4/bin/slapd/server/64

Messaging Server
pkgapp -c ./core.3496 -p /opt/SUNWmsgsr/lib

Web Server
pkgapp -c ./core.1092 -p /space/iws70/lib -s /var/crash

Calendar Server
pkgapp -r -c ./core -p /opt/SUNWics5/cal/lib

pkgapp -i -c 512 -p /usr/lib

pkgapp -i -r -c ./core -p /support/mysql-5.0.41/bin

Example: Runtime output

\* ----------------------------------------------------------------------------------
\* Sun Microsystems RSD pkgapp 3.0 Solaris                               [11/24/2008]
\* ----------------------------------------------------------------------------------
\* OS release                            [5.10]
\* Platform                              [SUNW,Sun-Blade-2500]
\* Checking [-c] is a core or pid        [using pid 1409]
\* Process Root                          [/support/mysql-5.0.41/data]
\* Databin parameter [-s] checks         [reset to /var/tmp/dev]
\* Databin found                         [/var/tmp/dev/test/cores/storage]
\* Databin writable check                [success]
\* Databin used/created is               [/var/tmp/dev/test/cores/storage/pkgapp-112408-05]
\* Creating temp area                    [/tmp/pkgapp.2928/]
\* Pid used, no corefile to check       
\* Process binary                        [mysqld]
\* Checking usage history                [not recently run]
\* mysqld binary bit version             [32]
\* Checking path [-p] to binary name     [success, path != binary name]
\* Checking path [-p] is a directory     [success]
\* Locating mysqld                       [success]
\* Checking located mysqld is 32 bit     [success]
\* Binary located                        [/support/mysql-5.0.41/bin/mysqld]
\* Adding binary to pkgapp.pldd          [success]
\* Grabbing pldd                         [success]
\* Grabbing pstack                       [success]
\* Grabbing pmap                         [success]
\* Grabbing pcred                        [success]
\* Grabbing pflags                       [success]
\* Grabbing pargs                        [success]
\* Provide the full path and name to the core file
\* If you do not have a core, enter "none"
\* Example - /data/cores/core.1445:      /var/tmp/dev/cores/core.1409
                                        [Answer was -> /var/tmp/dev/cores/core.1409]
\* Grabbing [-i] core/gcore              [success]
\* Javatools [-j] not set                [skipped]
\* Grabbing /var/adm/messages            [success]
\* Grabbing uname -a                     [success]
\* Grabbing date/time                    [success]
\* Grabbing showrev -p                   [success]
\* Grabbing pkginfo -l                   [success]
\* Grabbing /etc/release                 [success]
\* Grabbing coreadm                      [success]
\* Grabbing ulimit                       [success]
\* Grabbing libs                         [success]
\* Making lib paths app/                 [success]
\* Making lib paths libs/                [success]
\* Linking libraries                     [success]
\* Libraries linked                      [62 ttl]
\* Using hostid for naming .tar.gz       [837872d0]
\* Writing file                          [pkgapp-837872d0-s4u-2500a-brm04-081124-095809.tar.gz]
\* Done gathering files                 
\* Writing dbxrc & files     [success]
\* Writing manifest-081124-095809.log    [success]
\* Writing pkgapp-args-081124-095809     [success]
\* Creating final tarfile                [success]
\* Compressing tarfile                   [success]
\* End of runtime logging               
\* Saving history info                   [/var/tmp/pkgapp-history/history-081124-095809.log]
\* Saving runtime log                    [/var/tmp/pkgapp-history/runtime-081124-095809.log]
\* Removing [-r] temp area/files         [removed]
\* Operations Complete                  
Upload the following file(s) to your Cores Directory at Sun

1) File(s) located in directory /var/tmp/dev/test/cores/storage/pkgapp-112408-05

                [ pkgapp-837872d0-s4u-2500a-brm04-081124-095809.tar.gz ]

                                Thank you.
                                Sun Software Technology Service Center (STSC)

1) You can check for updates to this script here:
        BigAdmin -
2) Release Notes and Guides located here:
        Docs -
3) GDD information located here:
        Docs -

4) Please send all Bugs and RFE's to the following address:
        Subject "pkgapp bug/rfe" -

5) Please send all other questions etc to:
        Subject "pkgapp feedback" -

I will announce Pkgapp 3.0 for Solaris's availability in the next few days...stay tuned!



Does this only work on Solaris?
- Matthew

Posted by Matthew on November 23, 2008 at 12:22 PM MST #

Hi Mathew, so far yes, this is only available on Solaris. I will be porting the code to Linux and HP-UX soon.


Posted by Leroy Trujillo on November 24, 2008 at 07:05 AM MST #

Post a Comment:
  • HTML Syntax: NOT allowed

A Tech Blog about the Sun Java Systems Dirtracer Toolkit. Dirtracer and this blog written and maintained by Lee Trujillo an Oracle Senior Principal Support Engineer.


« July 2016