付録 J. Dr.Web Enterprise Agentの初回インストール時のスクリプトを使用する

ネットワークインストーラ(drwinst.exe)を使用した、Agent のワークステーションへのインストールルーチンはinstall.スクリプトによって設定されます。それらのファイルはリポジトリ内のプロダクトのルートフォルダにあります。標準的ディストリビューションでは、それらは10-drwupgrade及び20-drwagntdカタログ内にあり、デフォルトのインストールを記述します。

フォルダ内に.custom.install.script ファイルがある場合、標準的なインストールルーチンの代わりにそれが使われます。

 

ピリオドで始まる他の名前の付いたファイルは、製品更新の際に更新されず、リポジトリの操作に影響を与えません。

 

インストールの進行順序

1.ネットワークインストーラが サーバー に対し、プラットフォームwin-setup、common、win、win-nt、win-9x(これはデフォルトの順番での標準的プラットフォームのリストです)のインストールをリクエストします。プラットフォームを使う順番はdrwinsに発信する際に-platforms=p1,p2,p3...オプションパラメータによって変更できます。win-setupプラットフォームは標準的なディストリビューションには含まれておらず、必要に応じて独自のインストールルーチンを作成します。

2.サーバー が、全てのプロダクトをアルファベット順に調べることでプラットフォームのリストに応じてファイルのリストを作成、またinstall.scriptインストールルーチン内でプラットフォームに対してfiles{ }構文によって設定されたファイルのリストを作成します(下記参照)。 同時に、scripts{ }構文に基づいてサマリースクリプトが作成されます。

3.サーバー がファイルの全般的なリストとサマリースクリプトを受け取ります。

4.サーバー がネットワークインストーラによって実行されるファイルとスクリプトを送ります。

20-drwagntdフォルダの例でinstall.scriptを見てみます。

; master part of installation: Agent & its stuff.

; drwscr.dll goes with upgrader, so unlisted here.

 

platform{  ; win - for all Windows OS

          ; `name: XXX' MUST go first!

 

  name: win  ; (mandatory stanza)

             ; this platform name

 

             ; include, scripts{ }, files{ }

             ; can go in any order

 

  scripts {  ; (optional)

             ; script being merged with all others

win.inst.rexx ; and executed after transfer all

             ; files for all platforms requested

             ; by installer

             ; Windows installer request order:

             ; - win-setup (optional! for

             ;              customization)

             ;   - common

             ;   - win

             ;   - win-nt OR win-9x

        }

 

  files {    ; (optional)

             ; this platform files being

             ; transfered to installer

         win/uninstall.rexx

         win/drwinst.exe

         win/drwagntd.exe

         win/drwagnui.exe

         win/drwhard.dll

       }

}

 

platform {    ; win-9x - for Windows 95-ME

  name: win-9x

  scripts{ win-9x.inst.rexx }

}

 

platform {    ; win-nt - for Windows NT-2003

  name: win-nt

  scripts{ win-nt.inst.rexx }

}

 

platform {     ; common - for any OS including UNICES

   name: common

   scripts { common.inst.rexx }

}

 

; include file.name ; (optional)

    ; this stanza tells to include other file.

    ; including file will be searched in the

    ; same folder where current file are

    ; located if `file.name' does not include

    ; folder specificator

スクリプトにはplatform{}構文のリストが含まれ、include構文(includeは上の階層のみで使用でき、platform{ }内では使用できません)によって他のファイルからの定義も含むことが出来ます。include内のfile.nameが名前のみでパスを含んでいない場合、現在のファイルが置かれているフォルダ内で検索されます。含まれているファイル内でinclude構文を使うことができます。

プラットフォームの記述はname: XXX構文で始まり、その後にfiles{ }scripts{}のリストが続きます。リストの順番は重要ではありません。リストにはエレメントをいくつでも含むことが出来ます。リスト内のエレメントの順番は重要で、それによって端末に送られるファイルの順番、及び作成されるスクリプトの構文が定義されます。

platform{}構文の順番は重要ではありません。

下記はインストールスクリプトの変数(これらの変数の値はネットワークインストーラのコマンドラインから指定できます)とそのデフォルト値です。

spider.install   = 'yes'

spiderml.install = 'yes'

scanner.install  = 'yes'

install.home – installation folder

agent.logfile = install.home'\logs\drwagntd.log'

agent.loglevel = 'trace'

agent.logrotate = '10,10m'

agent.servers = install.servers

agent.serverkey = install.home'\drwcsd.pub'

agent.compression = 'possible'

agent.encryption = 'yes'

agent.findretry = '3'

agent.findtimeout = '5'

agent.spiderstatistics = '30'

agent.importantmsg = '2'

agent.discovery = 'udp/:2372'

agent.startmsg = '2' (or agent.startmsg = 'NONE')

agent.importantmsg パラメータは、ユーザーに対して更新エラー、再起動リクエスト等を表示するかどうかを定義します。 0 — 表示しません。 1 — ポップアップを表示します。

ここでは、 SpIDer Guard がインストールされておらず、ログの詳細レベルが最大に設定されているという、標準的ではないインストールのシナリオを作成してみます。

1.20-drwagntdフォルダ内に.win-setup.inst.rexxファイルを作成し、そこに次のように書き込みます。

spider.install = 'no'

agent.loglevel = 'all'

2.20-drwagntdフォルダ内に.custom.install.script ファイルを作成し、そこに次のように書き込みます。

include install.script

 

platform{

 name: win-setup

 scripts{ .win-setup.inst.rexx }

}

3.サーバー を再起動させるか、リポジトリの再起動を指示してください。

UNIX OS: kill -USR1 cat `drwcsd.pid`

Windows: drwcsd.exe rerepository