5. CAP の起動

CAP の起動は、手動で行なってもよいのだが、以下のようなスクリプトで起動 させると便利である。

/etc/rc.d/rc.local に次のようなステートメントを加える:

  #
  # start AppleShare server
  #
  if [ -f /usr/local/cap/rc.cap ]; then
      /usr/local/cap/rc.cap
  fi
  #----End of /etc/rc.d/rc.local----

# /usr/local/cap/rc.cap :

  #!/bin/sh

  echo "CAP server starting."
  /usr/local/cap/capd eth0 "hogehoge zone"
  /usr/local/cap/atis
  /usr/local/cap/aufs -l /var/log/aufs.log -n `hostname` \
  		-U 10 -G guest -V /usr/local/cap/afpvols
  #----End of /usr/local/cap/rc.cap----

CAP デーモンを起動させる capd コマンドは、第一引数に ネットワーク・インターフェースのデバイス名、第二引数は、CAP を動かしたい ゾーン名を指定する。 この場合、ネットワーク・インターフェースに対するデバイス名は、eth0、ゾーン名は、hogehoge zone となっているが、 各自の環境に合わせて変えてい ただきたい。なおゾーン名の中にスペースが入っている場合は、上記のように " (ダブル・クォーテーション)で囲んで記述する。プロンプトが返ってきた ら、成功ということである。さらにこのコマンドを発行すると /etc のディレ クトリに etalk.local という EtherTalk のダイナミック・ コンフィギュレーション・ファイルができる。これも成功の目安にする。

etalk.local ファイルの例:

  #
  # EtherTalk dynamic configuration data
  #
  # Last update:  Tue Apr 29 18:20:44 1997
  #
  # Generated by Kernel AppleTalk
  #
  interface       "eth0"
  netRangeStart   15.160
  netRangeEnd     15.160
  thisNet         15.160
  thisNode        52
  thisZone        "hogehoge zone"
  bridgeNet       15.160
  bridgeNode      167
  bridgeIP        127.0.0.1
  nisNet          15.160
  nisNode         52
  asyncNet         0.00
  asyncZone       ""
  # ----End of etalk.local----

なお /usr/local/cap/rc.cap ファイルの中の aufs コマンドについては、後述の 「ファイル・サーバの構築」 の項で説明する。次に atis が、正常に動いているかどうかを atistest というコマンドを使って検証する。次のような出力があれば、正常に 動いているということだ。

  # atistest
  CAP distribution 6.00 using Kernel Based EtherTalk encapsulation,
  June 1996 Copyright (c) 1986,1987,1988 by The Trustees of Columbia
  University in the City of New York

  abInit: [ddp:  15.160, 136], [GW:  15.160, 165] starting
  debugging NBP
  Registering "atis test:testing@*"
  NBP SndNBP: sending
  NBP nbp_timeout: 4 tick timeout on -1073743660, 3 remain
  NBP SndNBP: sending
  NBP nbp_timeout: 4 tick timeout on -1073743660, 2 remain
  NBP SndNBP: sending
  NBP nbp_timeout: 4 tick timeout on -1073743660, 1 remain
  NBP SndNBP: sending
  NBP nbp_timeout: 4 tick timeout on -1073743660, 0 remain
  NBP SndNBP: sending
  NBP status done: found -1073743660
  Okay

さてこれで各種 CAP プログラムを走らせるためのお膳立てができ た訳だ。