Solaris 7 System Administration Supplement

Chapter 4 Diagnostic Enhancements

This chapter describes the following new system administration information:


Note -

For the most up-to-date man pages, use the man command. The Solaris 7 11/99 man pages include new feature information not found in the Solaris 7 Reference Manual Collection.


Improved Core File Management (coreadm)

This functionality is updated in the Solaris 7 8/99 software release.

Enhanced process core file features that include the coreadm command update the Solaris 7 software release. This information supplements information on troubleshooting software problems found in "Troubleshooting Software Problems (Overview)" in the System Administration Guide, Volume II.

This release introduces the coreadm command, which provides flexible core file naming conventions and better core file retention. For example, you can use the coreadm command to configure a system so that all process core files are placed in a single system directory. This means it is easier to track problems by examining the core files in a specific directory whenever a Solaris process or daemon terminates abnormally.

Limitations of the previous Solaris process core dump features are:

Configurable Core File Paths

Two new configurable core file paths that can be enabled or disabled independently of each other are:

When a process terminates abnormally, it produces a core file in the current directory as in previous Solaris releases. But if the global core file path is enabled and set to /corefiles/core, for example, then each process that expires produces two core files: one in the current working directory and one in the /corefiles directory.

By default, the Solaris core paths and core file retention remain the same:

Expanded Core File Names

If a global core file directory is enabled, core files can be distinguished from one another by using the variables described in the following table.

Variable Name 

Variable Definition 

%p

Process ID 

%u

Effective user ID 

%g

Effective group ID 

%f

Executable file name 

%n

System node name, equivalent to the uname -n output

%m

Machine name, equivalent to the uname -m output

%t

Decimal value of time(2) system call 

%%

Literal % 

For example, if the global core file path is set to:

/var/core/core.%f.%p

and a sendmail process with PID 12345 terminates abnormally, it produces the following core file:

/var/core/core.sendmail.12345

Setting the Core File Name Pattern

You can set a core file name pattern on a global basis or a per-process basis. You can specify whether you want these settings saved across a system reboot.

For example, the following coreadm command sets the global core file pattern for all processes started by the init process. This pattern will persist across system reboots.


$ coreadm -i /var/core/core.%f.%p

Global core values are stored in the /etc/coreadm.conf file, which means these settings are saved across a system reboot.

This coreadm command sets the per-process core file name pattern for all processes:


$ coreadm -p /var/core/core.%f.%p $$

The $$ symbols represent a placeholder for the process ID of the currently running shell. The per-process core file name pattern is inherited by all child processes.

Once a global or per-process core file name pattern is set, it must be enabled with the coreadm -e command. See the procedures below for more information.

You can set the core file name pattern for all processes run during a user's login session by putting the command in a user's $HOME/.profile or .login file.

Enabling setuid Programs to Produce Core Files

You can use the coreadm command to enable or disable setuid programs to produce core files for all system processes or on a per-process basis by setting the following paths:

By default, both flags are disabled. For security reasons, the global core file path must be a full pathname, starting with a leading /. If superuser disables per-process core files, individual users cannot obtain core files.

The setuid core files are owned by the superuser with read/write permissions for the superuser only. Ordinary users cannot access them even if the process that produced the setuid core file was owned by an ordinary user.

See coreadm(1M) for more information.

How to Display the Current Core Dump Configuration

Use the coreadm command without any options to display the current core dump configuration.


$ coreadm
               global core file pattern: /var/core/core.%f.%p
                 init core file pattern: core
                      global core dumps: enabled
                 per-process core dumps: enabled
                global setid core dumps: enabled
           per-process setid core dumps: disabled
               global core dump logging: disabled

How to Set a Core File Name Pattern

  1. Determine whether you want to set a per-process or global core file and select one of the following:

    1. Set a per-process core file name pattern.


      $ coreadm -p $HOME/corefiles/%f.%p $$ 
      
    2. Set a global core file name pattern.

      Become superuser first.


      # coreadm -g /var/core/core.%f.%p
      

How to Display a Core File Name Pattern

Use the following coreadm command to inquire about the core file settings of the current process. The $$ symbols represent a placeholder for the process ID of the running shell.


$ coreadm $$
278:    core.%f.%p

Superuser can inquire about any user's core file settings by using coreadm process ID. Ordinary users can only inquire about the core file settings of their own processes.

How to Enable a Per-Process Core File Path

  1. Become superuser.

  2. Enable a per-process core file path.


    # coreadm -e process
    
  3. Display the current process core file path to verify the configuration.


    $ coreadm $$
    1180:   /home/kryten/corefiles/%f.%p

How to Enable a Global Core File Path

  1. Become superuser.

  2. Enable a global core file path.


    # coreadm -e global -g /var/core/core.%f.%p
    

  3. Display the current process core file path to verify the configuration.


    # coreadm
         global core file pattern: /var/core/core.%f.%p
           init core file pattern: core
                global core dumps: enabled
           per-process core dumps: enabled
          global setid core dumps: disabled
     per-process setid core dumps: disabled
         global core dump logging: disabled

Troubleshooting Core File Problems

Error Message

NOTICE: 'set allow_setid_core = 1' in /etc/system is obsolete
NOTICE: Use the coreadm command instead of 'allow_setid_core'
Cause

You have an obsolete parameter that allows setuid core files in your /etc/system file.

Solution

Remove allow_setid_core=1 from the /etc/system file. Then use the coreadm command to enable global setuid core file paths.

New Console Features for Remote Systems

This feature was new in the Solaris 7 5/99 software release.

The new console features in the Solaris 7 5/99 software release update the Solaris operating environment. This information supplements information on troubleshooting Solaris systems found in "Troubleshooting Software Problems (Overview)" in System Administration Guide, Volume II and in the Solaris Transition Guide.

The following new console features improve your ability to troubleshoot remote systems:

Using Auxiliary Console Messaging During Run Level Transitions

Keep the following in mind when using auxiliary console messaging during run level transitions:

Using the consadm Command During an Interactive Login Session

If you want to run an interactive login session by logging in to a system using a terminal that is connected to a serial port, and then using the consadm command to see the console messages from the terminal, note the following behavior.

How to Enable an Auxiliary (Remote) Console

The consadm daemon does not start monitoring the port until after you add the auxiliary console with the consadm command. As a security feature, console messages are only redirected until carrier drops, or the auxiliary console device is unselected. This means carrier must be established on the port before you can successfully use the consadm command.

See the man page consadm(1M) for more information on enabling an auxiliary console.

  1. Log in to the system as superuser.

  2. Enable the auxiliary console.


    # consadm -a devicename
    
  3. Verify that the current connection is the auxiliary console.


    # consadm
    

Example--Enabling an Auxiliary (Remote) Console


# consadm -a /dev/term/a 
# consadm
/dev/term/a

How to Display a List of Auxiliary Consoles

  1. Log in to the system as superuser.

  2. Select one of the following steps:

    1. Display the list of auxiliary consoles.


      # consadm
      /dev/term/a

      or

    2. Display the list of persistent auxiliary consoles.


      # consadm -p
      /dev/term/b

How to Enable an Auxiliary (Remote) Console Across System Reboots

  1. Log in to the system as superuser.

  2. Enable the auxiliary console across system reboots.


    # consadm -a -p devicename     
    

    This adds the device to the list of persistent auxiliary consoles.

  3. Verify that the device has been added to the list of persistent auxiliary consoles.


    # consadm
    

Example--Enabling an Auxiliary (Remote) Console Across System Reboots


# consadm -a -p /dev/term/a  
# consadm
/dev/term/a

How to Disable an Auxiliary (Remote) Console

  1. Log in to the system as superuser.

  2. Select one of the following steps:

    1. Disable the auxiliary console.


      # consadm -d devicename
      

      or

    2. Disable the auxiliary console and remove it from the list of persistent auxiliary consoles.


      # consadm -p -d devicename
      
  3. Verify that the auxiliary console has been disabled.


    # consadm
    

Example--Disabling an Auxiliary (Remote) Console


# consadm -d /dev/term/a 
# consadm

Improved System Boot and Error Message Format

This functionality was new in the Solaris 7 3/99 software release.

This supplements information on system boot and error messages found in "Viewing System Messages" in System Administration Guide, Volume II, and referenced in the Solaris Transition Guide.

The Solaris 7 3/99 release improves the system boot and error message format by providing a numeric identifier, module name, and time stamp to messages generated by the syslog logging facility. In addition, messages that were previously lost after a system panic and reboot are now saved.

The new message format can be enabled or disabled by setting the msgid property in the log.conf file. The new message format is not enabled by default. See the man page, log(7D), and the procedure below for more information.

For general information about system error logging, see the System Administration Guide, Volume II.

System Boot and Error Message Format Changes

If msgid is set to 0 in the log.conf file, there are no changes in the message format. If msgid is set to 1, there are two changes in the message format:

  1. The text of the message is preceded by a message ID that looks like this:

    [ID msgid facility.priority]

    For example:

    [ID 123456 kern.notice]

    The msgid identifier is described in the man page msgid(1M). The facility and priority identifiers are described in the man page, syslog.conf(4).

  2. If the message originated in the kernel, the kernel module name is displayed instead of just 'unix.'

    Previous message format:

    Oct 1 14:07:24 mars unix: alloc: /: file system full

    New message format:

    Oct 1 14:07:24 mars ufs: [ID 845546 kern.notice] alloc: /: file system full

How to Enable System Message IDs

  1. Become superuser.

  2. Enable system message IDs by adding the following line to the /platform/`uname -i`/kernel/drv/log.conf file, if it exists. Otherwise, add the msgid property to the /kernel/drv/log.conf file.


    msgid=1
  3. Save and close the file.

  4. Reboot the system by using the following command.


    # init 6
    

    Note -

    To enable system message IDs without rebooting the system, use the following adb command:


    # echo log_msgid/W1 | adb -kw
    

How to Disable System Message IDs

  1. Become superuser.

  2. Disable system message IDs by changing the msgid line in the /platform/`uname -i`/kernel/drv/log.conf file to the following, if it exists. Otherwise, change the msgid property to the /kernel/drv/log.conf file.


    msgid=0
  3. Save and close the file.

  4. Reboot the system by using the following command.


    # init 6
    

    Note -

    To disable system message IDs without rebooting the system, use the following adb command:


    # echo log_msgid/W0 | adb -kw