JavaScript is required to for searching.
ナビゲーションリンクをスキップ
印刷ビューの終了
Oracle Solaris 11.1 システムのインストール     Oracle Solaris 11.1 Information Library (日本語)
このドキュメントの評価
search filter icon
search icon

ドキュメントの情報

はじめに

パート I Oracle Solaris 11.1 のインストールオプション

1.  インストールオプションの概要

パート II インストールメディアを使用したインストール

2.  インストールの準備

3.  Live Media の使用

4.  テキストインストーラの使用

5.  メディアからブートする自動インストール

6.  Oracle Solaris インスタンスの構成解除または再構成

パート III インストールサーバーを使用したインストール

7.  複数のクライアントへの自動インストール

8.  インストールサーバーの設定

9.  インストールのカスタマイズ

10.  クライアントシステムのプロビジョニング

11.  クライアントシステムの構成

12.  ゾーンのインストールと構成

13.  初回ブート時のカスタムスクリプトの実行

初回ブート時に 1 度だけ実行する制御の実装

初回ブート時に 1 度だけ実行されるようにする方法

初回ブート時に実行するスクリプトの作成

SMF マニフェストファイルの作成

マニフェスト作成ツールの使用

生成されたマニフェストのカスタマイズ

スクリプトとサービス用の IPS パッケージの作成

IPS パッケージを作成して公開する方法

AI クライアントへの初回ブートパッケージのインストール

IPS パッケージのインストール方法

初回ブートサービスのテスト

スクリプトまたはサービスを更新する方法

14.  クライアントシステムのインストール

15.  自動インストールのトラブルシューティング

パート IV 関連タスクの実行

A.  Oracle Configuration Manager の操作

B.  デバイスドライバユーティリティーの使用

索引

ドキュメントの品質向上のためのご意見をください
簡潔すぎた
読みづらかった、または難し過ぎた
重要な情報が欠けていた
内容が間違っていた
翻訳版が必要
その他
Your rating has been updated
貴重なご意見を有り難うございました!

あなたの貴重なご意見はより良いドキュメント作成の手助けとなります 内容の品質向上と追加コメントのためのアンケートに参加されますか?

SMF マニフェストファイルの作成

スクリプトを実行するサービスを定義した SMF マニフェストファイルを作成します。

マニフェスト作成ツールの使用

svcbundle コマンドを使用して、有効なサービスマニフェストを生成できます。次の例では、デフォルトで、svcbundle コマンドによって生成されたマニフェストが一時的なサービスを指定し、multi-user 依存性を指定しています。

例 13-3 生成された SMF サービスマニフェスト

次のコマンドでは、「初回ブート時に実行するスクリプトの作成」に示したスクリプトの名前が start-method の値として指定されています。「スクリプトとサービス用の IPS パッケージの作成」で作成されたパッケージは /opt/site/first-boot-script.shfirst-boot-script.sh スクリプトをインストールするため、スクリプトの名前は /opt/site/first-boot-script.sh として指定されています。

次のコマンドでは、completed プロパティーが、プロパティーグループ名、プロパティー名、プロパティーのタイプ、およびプロパティーの初期値をコロンで区切ったリストで指定されています。

$ svcbundle -s service-name=site/first-boot-script-svc \
-s start-method=/opt/site/first-boot-script.sh \
-s instance-property=config:completed:boolean:false \
> first-boot-script-svc-manifest.xml

以下に示す生成されたサービスマニフェストでは、初回ブートスクリプト (/opt/site/first-boot-script.sh) は start メソッドの exec 属性の値です。completed プロパティーは、このサービスのデフォルトインスタンス (first-boot-script-svc:default) を定義する instance 要素に指定されています。

<?xml version="1.0" ?>
<!DOCTYPE service_bundle
  SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<!--
    Manifest created by svcbundle (2012-Jul-13 16:39:30-0700)
-->
<service_bundle type="manifest" name="site/first-boot-script-svc">
    <service version="1" type="service" name="site/first-boot-script-svc">
        <!--
            The following dependency keeps us from starting until the
            multi-user milestone is reached.
        -->
        <dependency restart_on="none" type="service"
            name="multi_user_dependency" grouping="require_all">
            <service_fmri value="svc:/milestone/multi-user"/>
        </dependency>
        <exec_method timeout_seconds="60" type="method" name="start"
            exec="/opt/site/first-boot-script.sh"/>
        <!--
            The exec attribute below can be changed to a command that SMF
            should execute to stop the service.  See smf_method(5) for more
            details.
        -->
        <exec_method timeout_seconds="60" type="method" name="stop"
            exec=":true"/>
        <!--
            The exec attribute below can be changed to a command that SMF
            should execute when the service is refreshed.  Services are
            typically refreshed when their properties are changed in the
            SMF repository.  See smf_method(5) for more details.  It is
            common to retain the value of :true which means that SMF will
            take no action when the service is refreshed.  Alternatively,
            you may wish to provide a method to reread the SMF repository
            and act on any configuration changes.
        -->
        <exec_method timeout_seconds="60" type="method" name="refresh"
            exec=":true"/>
        <property_group type="framework" name="startd">
            <propval type="astring" name="duration" value="transient"/>
        </property_group>
        <instance enabled="true" name="default">
            <property_group type="application" name="config">
                <propval type="boolean" name="completed" value="false"/>
            </property_group>
        </instance>
        <template>
            <common_name>
                <loctext xml:lang="C">
                    <!--
                        Replace this comment with a short name for the
                        service.
                    -->
                </loctext>
            </common_name>
            <description>
                <loctext xml:lang="C">
                    <!--
                        Replace this comment with a brief description of
                        the service
                    -->
                </loctext>
            </description>
        </template>
    </service>
</service_bundle>

生成されたマニフェストのカスタマイズ

svcbundle コマンドで生成されたサービスマニフェストは、何も変更せずに要件を満たしている可能性があります。次の例は、サービスマニフェストの変更を示しています。

サービスマニフェストを変更した場合は、svccfg validate コマンドを使用して、マニフェストが引き続き有効であることを確認します。

例 13-4 カスタマイズされた SMF サービスマニフェスト

生成されたサービスマニフェストの次のコピーでは、exec_method のデフォルトのタイムアウト (60 秒) を start メソッドのために増やしています。start メソッドが初回ブートスクリプトを実行するための十分な時間を確保します。

<?xml version="1.0" ?>
<!DOCTYPE service_bundle
  SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<!--
    Manifest created by svcbundle (2012-Jul-13 16:39:30-0700)
-->
<service_bundle type="manifest" name="site/first-boot-script-svc">
    <service version="1" type="service" name="site/first-boot-script-svc">
        <!--
            The following dependency keeps us from starting until the
            multi-user milestone is reached.
        -->
        <dependency restart_on="none" type="service"
            name="multi_user_dependency" grouping="require_all">
            <service_fmri value="svc:/milestone/multi-user"/>
        </dependency>
        <!--
            Make sure the start method has adequate time to run the script.
        -->
        <exec_method timeout_seconds="360" type="method" name="start"
            exec="/opt/site/first-boot-script.sh"/>
        <!--
            The exec attribute below can be changed to a command that SMF
            should execute to stop the service.  See smf_method(5) for more
            details.
        -->
        <exec_method timeout_seconds="60" type="method" name="stop"
            exec=":true"/>
        <!--
            The exec attribute below can be changed to a command that SMF
            should execute when the service is refreshed.  Services are
            typically refreshed when their properties are changed in the
            SMF repository.  See smf_method(5) for more details.  It is
            common to retain the value of :true which means that SMF will
            take no action when the service is refreshed.  Alternatively,
            you may wish to provide a method to reread the SMF repository
            and act on any configuration changes.
        -->
        <exec_method timeout_seconds="60" type="method" name="refresh"
            exec=":true"/>
        <property_group type="framework" name="startd">
            <propval type="astring" name="duration" value="transient"/>
        </property_group>
        <instance enabled="true" name="default">
            <property_group type="application" name="config">
                <propval type="boolean" name="completed" value="false"/>
            </property_group>
        </instance>
        <template>
            <common_name>
                <loctext xml:lang="C">
                    <!--
                        Replace this comment with a short name for the
                        service.
                    -->
                </loctext>
            </common_name>
            <description>
                <loctext xml:lang="C">
                    <!--
                        Replace this comment with a brief description of
                        the service
                    -->
                </loctext>
            </description>
        </template>
    </service>
</service_bundle>
$ svccfg validate first-boot-script-svc-manifest.xml