Skip Navigation Links | |
Exit Print View | |
Installing Oracle Solaris 11.1 Systems Oracle Solaris 11.1 Information Library |
Part I Oracle Solaris 11.1 Installation Options
1. Overview of Installation Options
Part II Installing Using Installation Media
2. Preparing for the Installation
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
10. Provisioning the Client System
11. Configuring the Client System
12. Installing and Configuring Zones
13. Running a Custom Script During First Boot
Creating a Script to Run at First Boot
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
15. Troubleshooting Automated Installations
Part IV Performing Related Tasks
A. Working With Oracle Configuration Manager
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.
These easiest way to create this simple service is to use the svcbundle command as shown in Using the Manifest Creation Tool.
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.
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.
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