JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Installing Oracle Solaris 11.1 Systems     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information


Part I Oracle Solaris 11.1 Installation Options

1.  Overview of Installation Options

Part II Installing Using Installation Media

2.  Preparing for the Installation

3.  Using Live Media

4.  Using the Text Installer

5.  Automated Installations That Boot From Media

6.  Unconfiguring or Reconfiguring an Oracle Solaris instance

Part III Installing Using an Install Server

7.  Automated Installation of Multiple Clients

8.  Setting Up an Install Server

9.  Customizing Installations

10.  Provisioning the Client System

11.  Configuring the Client System

12.  Installing and Configuring Zones

13.  Running a Custom Script During First Boot

Implementing Run Once at First Boot Controls

How to Ensure One Run at First Boot

Creating a Script to Run at First Boot

Creating an SMF Manifest File

Using the Manifest Creation Tool

Customizing the Generated Manifest

Creating an IPS Package for the Script and Service

How to Create and Publish the IPS Package

Installing the First-Boot Package on the AI Client

How to Install the IPS Package

Testing the First-Boot Service

How to Update the Script or Service

14.  Installing Client Systems

15.  Troubleshooting Automated Installations

Part IV Performing Related Tasks

A.  Working With Oracle Configuration Manager

B.  Using the Device Driver Utility


Implementing Run Once at First Boot Controls

The following procedure shows how to ensure that the script runs only at the first boot of the newly installed system, and that the script runs only one time.

How to Ensure One Run at First Boot

  1. Create a service to run the script.

    These easiest way to create this simple service is to use the svcbundle command as shown in Using the Manifest Creation Tool.

  2. Set a script completion flag before the script runs.

    Define a Boolean completion property in the service manifest, and set its value to false. See the completed property in the manifest in Example 13-3.

  3. Set the script completion flag at the end of the script.

    Use the svccfg command to set the completed property to true at the end of the script. Use the svcadm command to refresh the service with the new property value. See the end of the sample script in Example 13-1.

  4. Disable the service if the script completed.

    In the service manifest, the default service instance is created and enabled. The service is disabled in the script. When you exit your first-boot script, use the SMF_EXIT_TEMP_DISABLE exit code to exit the start method of the service and temporarily disable the service. The service is disabled, and the stop method of the service does not run.

    Temporarily disabling the service is preferable to permanently disabling the service so that the service can be more easily re-enabled. In some situations, the script (and therefore the service) must be re-run to update configuration work that was done, such as zone cloning or migration. If the service is permanently disabled, the svcadm enable command must be run to re-enable the service.

    Temporarily disabling the service is also preferable to leaving the service online. A service that is online might appear to be doing work on every reboot. In this example, the name of the service is site/first-boot-script-svc. After the client is booted, you can see the service is in the disabled state:

    $ svcs first-boot-script-svc
    STATE          STIME    FMRI
    disabled        8:24:16 svc:/site/first-boot-script-svc:default