/etc/system.d/ Directory Files

The /etc/system file provides a static mechanism for adjusting the values of kernel parameters. Values specified in this file are read at boot time and then applied. No changes specified in the file take effect unless the system is rebooted.

However, to tune parameters, do NOT edit the /etc/system file. Instead, use files in the /etc/system.d directory. This method enables you to tune system parameters without directly manipulating the /etc/system file. The method consists of the following steps:

  1. Create an empty file in the /etc/system.d directory.

  2. Provide the file with a company specific name and indications of its contents.

  3. In the file itself, add the customized setting for the tunable you are configuring.

    As a first step, add only those tunables that are required by in-house or third-party applications. After baseline testing has been established, evaluate system performance to determine if additional tunable settings are required.

Files in the /etc/system.d directory are read at boot time and their contents are added to the /etc/system file. At the end of the boot process, the new configurations are applied to the system.

One pass is made to set all the values before the configuration parameters are calculated.

Example 1-1 Setting a ZFS Parameter for a Specific System

The following entry sets the ZFS ARC maximum (zfs_arc_max) to 30 GB.

            set zfs:zfs_arc_max = 0x780000000
         

Suppose that the name of your company is Widget, Inc. You would store this entry in the /etc/system.d/widget:zfs file. To apply the new zfs_arc_max setting, reboot the machine.

You can recover from an incorrect value by using one of the following approaches:

  • Resetting the Parameter in the /etc/system.d/file

    Remove the defective parameter setting from your configuration file in the /etc/system.d directory. At boot time, the /etc/system file is updated with the previous configurations which are then reapplied to the system.

  • Using a Cloned Boot Environment

    Before you introduce system parameter changes, clone the boot environment first.

    # beadm create BE-clonename
                   
                

    Then, if your current BE becomes unusable after applying changes to /etc/system, reboot the system. From the x86 GRUB menu or SPARC boot menu, select the BE clone. After booting completes, you can optionally activate the BE clone to become the default BE to be used in subsequent system boots.

  • Using File Copies

    Make a copy of the /etc/system file before updating it with new parameters from configuration files in the /etc/system.d directory so that you can easily recover from incorrect value. For example:

    # cp
                   /etc/system /etc/system.good
                

    If a value specified in the configuration file in /etc/system.d causes the system to become unbootable, you can recover with the following command:

    ok boot -a
                

    This command causes the system to ask for the name of various files used in the boot process. Press the Return key to accept the default values until the name of the /etc/system file is requested. When the Name of system file [/etc/system]: prompt appears, type the name of the good /etc/system file or /dev/null:

    Name of system file [/etc/system]: /etc/system.good
                

    If /dev/null is specified, this path causes the system to attempt to read from /dev/null for its configuration information. Because this file is empty, the system uses the default values. After the system is booted, the /etc/system file can be corrected.

    For more information about system recovery, see Troubleshooting System Administration Issues in Oracle Solaris 11.4.