If ever you are caught trying to debug a rare secondary panic issue (e.g. a panic while generating the crash dump), then this may help you out.
Normally, when a system panics, if kmdb is loaded, the panic sequence will stop there first, giving the user chance to poke around first before the dump is take (which can sometimes fail, and hence it is useful to get a kmdb session first).During deferred dump development, there were times when I needed to stop in kmdb, but not on the initial panic. The only documented tool available is setting nopanicdebug, but this prevents any entry to kmdb in the panic codepath, which was not quite what I wanted.
There is another variable which can be utilised to govern this behaviour – panic_forced, as used by the “reboot -d” codepath to avoid the initial kmdb entry during the panic sequence, where the panic is expected. However, it does not prevent subsequent panics from entering the debugger, which is just want I needed. This can be set via /etc/system, rather neatly now that Solaris 11.3 supports fragments:
# echo set panic_forced=1 > /etc/system.d/kmdb_entry
After a reboot, as long as kmdb is loaded, only secondary panics will stop in kmdb for further debugging.
