Solaris 1: How to set up savecore


Let's talk about how to enable the savecore command so that we can capture the image of a system crash. Although the concept is basically the same for both Solaris 1 and 2, there are some subtle differences. Here is the procedure for Solaris 1 systems.

Customizing /etc/rc.local

In Solaris 1, using the BSD-based SunOS 4.X, the savecore command is called from the boot-time, run-command script /etc/rc.local . By default, the savecore commands are commented out, as shown in this partial view of /etc/rc.local .

Example 3-1 Savecore commented out in /etc/rc.local
 #  # Default is to not do a savecore  #  # mkdir -p /var/crash/`hostname`  # echo -n 'checking for crash dump... '  # intr savecore /var/crash/`hostname`  # echo '' 

To enable savecore at boot time, the /etc/rc.local file needs to be modified so that the savecore command is enabled. Be careful not to uncomment the actual comment, which reads "# Default is to not do a savecore". Once modified, this portion of / etc/rc.local should read:

Example 3-2 Savecore enabled in /etc/rc.local
 #  # Default is to not do a savecore  #  mkdir -p /var/crash/`hostname`  echo -n 'checking for crash dump... '  intr savecore /var/crash/`hostname`  echo '' 

This sequence of commands will create a directory in /var/crash named after your system's hostname. The "hostname" portion of the command is interpreted to mean: First, run the UNIX hostname command, then use the output of that command as part of the mkdir command. For example, if your system's name is "maugrim", the resulting command will be:

 mkdir -p /var/crash/maugrim 

The -p option of mkdir says to create the parent directories if they don't already exist.

If you want to use a different savecore directory, modify both the mkdir command and the savecore commands. As an example:

Example 3-3 Savecore and the verbose option enabled in /etc/rc.local
 #  # Default is to not do a savecore  #  mkdir -p /opt/spare/crashes  echo -n 'checking for crash dump... '  intr savecore -v /opt/spare/crashes  echo '' 

In this example, the hostname command is not used at all, as we've specified the full directory name instead. Also, here we've called the savecore command with its only option, -v , which generates more verbose output when it runs. By default, savecore is called without options. You'll notice that we are also calling savecore via the intr command. Commands run within the / etc/rc* scripts are not normally interruptible; however, when called with the intr command, they are.

Finally, the two echo commands are there simply to print useful information to the console during the boot-up process.

Configuring a special dump device

We've already talked about the dump device and know that the primary swap device is usually used as the dump device. On Solaris 1 systems, it is very easy to specify a dump device other than the swap device. This is done through the system configuration file, on the config line, which describes where your root file system and swap partition exist. For complete details, refer to the man page on config (8).

As an example, here are config lines from two system configuration files. The first, shown here, will result in system crash dumps being stored on the swap device,

 config vmunix swap on sd1b 

whereas the second, shown below, specifies a dump device different from the swap device.

 config vmunix swap on sd1b dumps on sd2f 

If you want to specify a separate dump device, you will need to modify a kernel configuration file, config and make a new kernel, and boot up the new kernel. Please refer to the appropriate System Administrator's manual for guidance if you aren't already familiar with the procedure to build a new kernel.

graphics/03fig01.gif

When specifying a special dump device on any UNIX system, do not under any circumstances specify a device that has a file system on it, nor a partition used in raw mode by a database application. Like a swap partition, the dump device knows nothing about file systems, superblocks, inodes, and data. During the panic, the contents of memory are written to the dump device without regard for what is being overwritten. Please choose your system crash dump device carefully !

We hope you understand and appreciate the importance of this.



PANIC. UNIX System Crash Dump Analysis Handbook
PANIC! UNIX System Crash Dump Analysis Handbook (Bk/CD-ROM)
ISBN: 0131493868
EAN: 2147483647
Year: 1994
Pages: 289
Authors: Chris Drake

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net