このオプションはサービスへ接続される直前に実行されるコマンドで す。これは普段の管理の代行として機能します。
以下は、ユーザにログインする度に、それを歓迎するメッセージを送 信する面白い例です。日々の伝言(MOTD)とでもいいましょうか?以下 に例を示します:
csh -c 'echo \"Welcome to %S!\" | \ /usr/local/samba/bin/smbclient
-M %m -I %I' &
勿論、こんなことをしてしまうと、後で周りから迷惑がられますが‥‥。
クリーンアップコマンドも参照してください。
デフォルト: なし (コマンドは実行されません)
例: echo \"%u connected to %S from %m (%I)\" >> /tmp/log
これは上の設定とrootで実行されること以外は同じです。これは、接 続が成立する前に、(CD-ROMのような)ファイルシステムをマウントす る際に役に立ちます。
このオプションはサービスへの接続が切断した際に、実行されるコマ ンドを指定します。これは普段の管理の代行として機能します。コマ ンドは同システムのroot権限で実行することも可能です。
下は、サービスリソースを自動的にアンマウントする実用的な例です。
/sbin/umount /mnt/cdrom
セットアップ・コマンドも参照してください。
デフォルト: なし (実行されるコマンドはありません)
例: echo \"%u disconnected from %S from %m (%I)\" >> /tmp/log
これは上の設定とrootで実行されること以外は同じです。これは、接 続が切れた後に、(CD-ROMのような)ファイルシステムをアンマウント する際に役に立ちます。
This parameter specifies the name of a file which, if opened, will be executed by the server when the file is closed. This allows a UNIX script to be sent to the Samba host and executed on behalf of the connected user.
Scripts executed in this way will be deleted upon completion, permissions permitting.
If the script generates output, output will be sent to the file specified by the magic output parameter (see above).
Note that some shells are unable to interpret scripts containing carriage-return-linefeed instead of linefeed as the end-of-line marker. Magic scripts must be executable "as is" on the host, which for some hosts and some shells will require filtering at the DOS end.
Magic scripts are EXPERIMENTAL and should NOT be relied upon!
Default: None. Magic scripts disabled.
Example: user.csh