Knowing when a crash dump is complete

If you're doing kernel development on solaris, every so often you'll crash a machine.  It will save a crash dump to the dump device and then on reboot, the dumpadm service (svc:/system/dumpadm:default) will invoke savecore to copy from the dump device to the filesystem.

Since SMF goes out of its way to let services start in parallel, and dumpadm is one of those services, it might not be done by the time you log in to start investigating the crime scene.

It's annoying to have to periodically poll to see if it's done (sometimes it takes a while) so you can do something like:

  cd  /var/crash/$(hostname); svcadm -v enable -s dumpadm; mdb -k N

and then go about your business until you see an mdb prompt in that window.

This relies on the the -s option to svcadm (which causes it to wait until the service is done attempting to start) as well as the fact that enabling an already-enabled service is a no-op.

Comments:

Better still would be 'svcadm ... && mdb ...', since it is possible for svcadm -s to fail (e.g. if the dumpadm service's dependencies are unsatisfiable).

Posted by Dave on September 19, 2008 at 01:45 PM EDT #

Hmmm... I always uttered "pwait `pgrep savecore` ; mdb" but yours (and Dave's) is an improvement.

Posted by Dan McDonald on September 22, 2008 at 07:25 AM EDT #

Post a Comment:
Comments are closed for this entry.
About

sommerfeld

Search

Top Tags
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today