Today I will revisit Pkg_app but will focus on its uses within Dirtracer.
Before Dirtracer 6.0.4 Customers who would use Dirtracer to gather cores and gcores would have to run Pkg_app manually after the fact.
Since version 6.0.4 Dirtracer has included Pkg_app in the <Dirtracer Install Path>/dirtracertools/ location and with the Quiet (-q) switch in Pkg_app 2.7 I able to embed Pkg_app within Dirtracer to run automatically.
If a Customer uses the following config file parameters Pkg_app will be launched automatically.
CORE_LOCATION="<full path to the core> + SERVER_DOWN="1"
GRAB_GCORE="1" or GRAB_GCORE="2"
Here is an example of the following config: I used 1 check and 1 second interval for brevity.
See the runtime-<date>-<time>.log:
As you see below Dirtracer completes a quick one second loop, exits the Main Loop and grabs a Gcore.
\* pms.sh interval(1) x checks(1) [pms.sh run time (1 sec.)]
\* Entering Main Performance Gathering Loop
\* Loop 0 - 080509-075120
\* Grabbing gcore 080509-075122 [success]
Once Dirtracer finishes with the Post Loop gathering, it executed Pkg_app to have it gather all libraries and the ns-slapd binary. Note the normal Pkg_app processing information is not seen because Pkg_app has been launched with the Quiet (-q) option.
\* Packaging files
\* Preparing files - pkg_app [waiting 120 sec.] [success]
In Dirtracer 6.0.4 customers grabbing large cores/gcores with Dirtracer saw what they thought was a pkg_app hang. It was likely the core/gcore had overflowed the core header and Pkg_app could not process the file correctly. As a result I created a timer function to monitor processes like Pkg_app.
If the Pkg_app runs for more than 120 seconds, then Dirtracer will "kill" the pkg_app process and alert the Customer they need to run Pkg_app manually.
\* Packaging files
\* Preparing files - pkg_app [killed]
If Pkg_app was successful then it will present the Customer with the following message; see 2) below.
1) Dirtracer capture data located in directory [ /var/tmp/data/051308-01 ]
Upload "only" this file to your supportfiles.sun.com cores directory at Sun
[ dirtracer-834d2699-kaneda-080513-090202.tar.gz ]
2) pkg_app has captured system libs as the result of a gcore or core being found
As this file may be large, please ftp this separately to Sun
pkg_app file located in /var/tmp/data/051308-01/pkg_app_data
Currently Dirtracer does not give a major alert if Pkg_app was killed. The customer should manually run Pkg_app or gather the libraries used by the process.