From ffbf5c8b595dc9b227616efff0b021f8a805acfa Mon Sep 17 00:00:00 2001 From: fukachan Date: Mon, 16 Jan 2006 10:24:27 +0000 Subject: several examples around on log, hooks, troubleshootings. --- fml/doc/en/tutorial/include/chapters.ent | 13 +- fml/doc/en/tutorial/internals/hook.sgml | 14 +- fml/doc/en/tutorial/operations/log.sgml | 12 +- fml/doc/en/tutorial/operations/recipes.log.sgml | 156 +++++++++++++++ fml/doc/ja/tutorial/include/chapters.ent | 9 +- fml/doc/ja/tutorial/internals/hook.sgml | 14 +- fml/doc/ja/tutorial/internals/recipes.hook.sgml | 62 ++++++ fml/doc/ja/tutorial/operations/log.sgml | 12 +- fml/doc/ja/tutorial/operations/recipes.log.sgml | 168 ++++++++++++++++ fml/doc/ja/tutorial/troubleshoot/chapter.sgml | 3 +- .../ja/tutorial/troubleshoot/recipes.message.sgml | 212 +++++++++++++++++++++ fml/doc/ja/tutorial/troubleshoot/recipes.sgml | 54 +++++- 12 files changed, 713 insertions(+), 16 deletions(-) create mode 100644 fml/doc/en/tutorial/operations/recipes.log.sgml create mode 100644 fml/doc/ja/tutorial/internals/recipes.hook.sgml create mode 100644 fml/doc/ja/tutorial/operations/recipes.log.sgml create mode 100644 fml/doc/ja/tutorial/troubleshoot/recipes.message.sgml diff --git a/fml/doc/en/tutorial/include/chapters.ent b/fml/doc/en/tutorial/include/chapters.ent index b809d542..574a8e58 100644 --- a/fml/doc/en/tutorial/include/chapters.ent +++ b/fml/doc/en/tutorial/include/chapters.ent @@ -1,5 +1,5 @@ @@ -127,13 +127,11 @@ - - - - + + @@ -192,6 +190,7 @@ + @@ -217,6 +216,10 @@ + + + + diff --git a/fml/doc/en/tutorial/internals/hook.sgml b/fml/doc/en/tutorial/internals/hook.sgml index 206e4d5c..56c4f75d 100644 --- a/fml/doc/en/tutorial/internals/hook.sgml +++ b/fml/doc/en/tutorial/internals/hook.sgml @@ -1,5 +1,5 @@ @@ -122,4 +122,16 @@ The naming convension may differ from this convension. + + + Recipes + + + +§.hook.recipes; + + + + + diff --git a/fml/doc/en/tutorial/operations/log.sgml b/fml/doc/en/tutorial/operations/log.sgml index fc0480c6..daf9e820 100644 --- a/fml/doc/en/tutorial/operations/log.sgml +++ b/fml/doc/en/tutorial/operations/log.sgml @@ -1,5 +1,5 @@ @@ -81,4 +81,14 @@ $log_computer_output_engine in config.cf file. + + + Recipes + + +§.op.log.recipes; + + + + diff --git a/fml/doc/en/tutorial/operations/recipes.log.sgml b/fml/doc/en/tutorial/operations/recipes.log.sgml new file mode 100644 index 00000000..758fad62 --- /dev/null +++ b/fml/doc/en/tutorial/operations/recipes.log.sgml @@ -0,0 +1,156 @@ + + + + + + + + + + +show fml error log of yesterday. + + + + + +daily.pl of &fml4; is not implemented yet. + + + +Currently use grep to parse the log file. + + + + + + + + + + +See old logs. + + + + + +&fml8; appends log messages continuously into the log file at +$ml_home_directory by default. All log messages exist in it. + + + +On the other hand, Unix log expires. +So you cannot trace too lod messages. + + + +Please tune parameters of expiration tools e.g. newsyslog which +program differs from unix variants to variants to save log messages in +at least 3 months. + + + + + + + + + + + +Centralize log messages. + + + + + +Unix uses syslog mechanism. +To redirect all messages to /var/log/messages, set the following: + +[/etc/syslog.conf] + +*.* /var/log/messages + + + + +Also, &fml8; can use syslog mechanism. + +[/var/spool/ml/elena/config.cf] + +log_type = syslog + + + + +To use these configuration, all messages are centralized to +/var/log/messages file. + + + + + + + + + + + +extract specific log messages in monitoring. + + + + + + +% tail -F /var/spool/ml/elena/log | grep 'PATTERN' + + + + + + + + + + + + +extrace the specific log messages with coping it. + + + + + + + +% tail -F /var/spool/ml/elena/log | grep 'PATTERN' | tee FILE + + + + + + + + + + + + +Expire old log files. + + + + + +Newsyslog mechanism provided by &fml4; is not implemented. + + + + + + + diff --git a/fml/doc/ja/tutorial/include/chapters.ent b/fml/doc/ja/tutorial/include/chapters.ent index c8e946a2..1df327f5 100644 --- a/fml/doc/ja/tutorial/include/chapters.ent +++ b/fml/doc/ja/tutorial/include/chapters.ent @@ -1,5 +1,5 @@ @@ -133,13 +133,10 @@ - - - - + @@ -198,6 +195,7 @@ + @@ -224,6 +222,7 @@ + diff --git a/fml/doc/ja/tutorial/internals/hook.sgml b/fml/doc/ja/tutorial/internals/hook.sgml index d66de589..f683df07 100644 --- a/fml/doc/ja/tutorial/internals/hook.sgml +++ b/fml/doc/ja/tutorial/internals/hook.sgml @@ -1,5 +1,5 @@ @@ -124,4 +124,16 @@ sub run + + + レシピ’s + + + +§.hook.recipes; + + + + + diff --git a/fml/doc/ja/tutorial/internals/recipes.hook.sgml b/fml/doc/ja/tutorial/internals/recipes.hook.sgml new file mode 100644 index 00000000..4923d573 --- /dev/null +++ b/fml/doc/ja/tutorial/internals/recipes.hook.sgml @@ -0,0 +1,62 @@ + + + + + + + +HOOK で使うべきおすすめの変数名はなんですか? + + + + + +HOOK 内で使う変数を my() で制限してくれれば、特に制限はないです。 + +$hook = q{ + my $x = $config->{ xxx }; + my $y = $config->{ yyy }; + if ($x eq $y) { + SOME ACTION + } +}; + + + + + + + + + + + + +HOOK で変更してよい変数はなんですか? + + + + + + +$config オブジェクトへの代入操作は問題ありません。 +また $curproc が提供するアクセスメソッドで変更できるものについても +自由にアクセスメソッドを使って下さい。 + + + +理屈の上では HOOK で $curproc 経由でアクセスできる全てのものを変更して +好きなように &fml8; を操作することが出来ますが、アップグレードなどの保 +証は一切ありません。 + + + +アップグレードしても問題のない HOOK を書くには +$curproc のアクセスメソッドだけを使って書くようにしてください。 + + + + + diff --git a/fml/doc/ja/tutorial/operations/log.sgml b/fml/doc/ja/tutorial/operations/log.sgml index 14929366..2c5b73e2 100644 --- a/fml/doc/ja/tutorial/operations/log.sgml +++ b/fml/doc/ja/tutorial/operations/log.sgml @@ -1,5 +1,5 @@ @@ -89,4 +89,14 @@ FML::Log::Print::Simple + + + レシピ’s + + +§.op.log.recipes; + + + + diff --git a/fml/doc/ja/tutorial/operations/recipes.log.sgml b/fml/doc/ja/tutorial/operations/recipes.log.sgml new file mode 100644 index 00000000..ea654fcc --- /dev/null +++ b/fml/doc/ja/tutorial/operations/recipes.log.sgml @@ -0,0 +1,168 @@ + + + + + + + + +前日の fml のエラーログを出したい + + + + + +&fml4; の daily.pl にあたるものは未実装です。 + + + +現状ではログファイルを grep してください。 + + + + + + + + + + +古いログを見たい + + + + + +&fml8; はデフォルトではMLのホームディレクトリにあるログファイルにひ +たすら書き込んでいきます。MLが始まった時からの記録が全てここにありま +す。 + + + +一方、Unix のログは一定期間後に削除されていってしまうのであまり古いロ +グは追えません。 + + + +newsyslog など(OS によって仕組みは異なる) OS 附属のシステムが古いログ +の消去をしてます。あらかじめ、これらのパラメータを調整し、三カ月程度は +保存するようにしておきましょう。 + + + + + + + + + + + +ログを一極集中させたい + + + + + +Unix では syslog というメカニズムでログを管理しています。syslogd が受 +けとったメッセージは /etc/syslog.conf に従いファイルへの書き込みや他ホ +ストへの転送がなされます。 + +[/etc/syslog.conf] + +# すべてのログを /var/log/messages へ出力する +*.* /var/log/messages + + + + +&fml8; のログはデフォルトでは各MLのホームディレクトリにあるログファ +イルへ書き込まれますが syslog へ出力することも出来ます。 + +[/var/spool/ml/elena/config.cf] + +log_type = syslog + + + + +上述の「全てを記録する syslog 」設定とあわせて /var/log/messages にシ +ステム全てのログと fml のログを集めることが出来るというわけです。 + + + + + + + + + + + +ログを見張りつつ特定の行だけを見たい + + + + + +fml8 の問題というより Unix コマンドの使い方の話です。 + + + +ある「パターン」にマッチするメッセージだけを表示させたいなら次のように +します。 + +% tail -F /var/spool/ml/elena/log | grep 'パターン' + + + + + + + + + + + + +ログのコピーをとりつつ見張り、かつエラー行だけ見る + + + + + +fml8 の問題というより Unix コマンドの使い方の話です。 + + + + + +% tail -F /var/spool/ml/elena/log | grep 'パターン' | tee ファイル + + + + + + + + + + + + +古いログファイルを消去したい + + + + + +&fml4; の newsyslog 機能に当たるものは未実装です。 + + + + + + + diff --git a/fml/doc/ja/tutorial/troubleshoot/chapter.sgml b/fml/doc/ja/tutorial/troubleshoot/chapter.sgml index 300d59a7..cd8de29b 100644 --- a/fml/doc/ja/tutorial/troubleshoot/chapter.sgml +++ b/fml/doc/ja/tutorial/troubleshoot/chapter.sgml @@ -1,5 +1,5 @@ @@ -21,6 +21,7 @@ &recipe.listup.addresses; &recipe.listup.aliases; &troubleshoot.recipes; +&troubleshoot.recipes.message; diff --git a/fml/doc/ja/tutorial/troubleshoot/recipes.message.sgml b/fml/doc/ja/tutorial/troubleshoot/recipes.message.sgml new file mode 100644 index 00000000..61946cb2 --- /dev/null +++ b/fml/doc/ja/tutorial/troubleshoot/recipes.message.sgml @@ -0,0 +1,212 @@ + + + + + + + +受信したメールに Reply-To: がついていないようです + + + + + + +別についている必要はありませんのでエラーでも何でもありません。 + + + +また「ついていない」という意味を確認したほうがよいでしょう。メールリー +ダが表示していないだけかも知れません。メールヘッダをすべて表示するよう +にして確認してもらうようにして下さい。 + + + +なお、デフォルトでは fml8 が配送した記事には Reply-To: がついています。 +もし元々のメールに Reply-To: 指定があった場合は、そのまま元の Reply-To: が +ついています。 +もし元のメールに Reply-To: がないなら fml8 が適切なものをつけます。 +たとえば、記事であれば投稿用のアドレス、コマンドメールの返事であれば +コマンドメールのアドレスです。 + + + +ただ fml8 が Reply-To: をつけないように設定してあるのならつきません。 +元々のメールに Reply-To: がければ、そのまま Reply-To: のないメールが配 +送されます。 + + + + + + + + + + + +返信先が期待通りでないようです + + + + + +まず「返信先」とは何のことをいっているのか?を確認しましょう。 + + + +おそらくメールリーダで返信をクリックしたら用意されたテンプレートの +宛先が期待通りでなかったということをいっているのだとはおもいます。 + + + +ふつう、その宛先は Reply-To: なければ From: が使われているはずです。 +メールリーダで加工されていないヘッダを表示してどうなっているかを確認し +てもらって下さい。 + + + +なお、Reply-To: については前レシピを参照して下さい。 + + + + + + + + + + + +References: や In-Reply-To: がついていません + + + + + +これは元のメールについていないためです。 +そのため送信者のメールリーダがつけていないということになります。 +どうにもなりません。 + + + +fml8 は References: や In-Reply-To: についてなにもしません。 +素通しです。 + + + + + + + + + + +メールリーダでスレッドが表示できません。 + + + + + +fml8 はこれらのヘッダフィールドに対して何もしません。 +元のメールに In-Reply-To: や References: がないためと考えられます。 + + + +前レシピも参照して下さい。 + + + + + + + + + + +MLの受信者のうち一部の人だけ文字化けするそうです。 + + + + + +全員なら fml8 に問題がある可能性もありますが、 +一部の人だけ文字化けするのであれば、 +その人たちのメール環境の問題です。 + + + +ただ元々のメールが特殊で一部の人だけ読めないという可能性(たとえば M$ +星人の人たちだけで勝手に見えているようなメールとメールリーダの組)もあ +るので、一概に読む側が悪いとも言い切れない気がしますが… + + + + + + + + + + + +どうしても ISO-2022-JP で送ってこない人がいます + + + + + +MIME ヘッダを見てメールリーダがよろしく頑張ってしまうので、 +現代では問題とされないことが多くなってしまったかもしれません。 + + + +無理矢理 fml8 側で変換できないわけではありませんが、整合性がとれなくな +るので、やめたほうがいいでしょう。メールリーダにおまかせです。 + + + + + + + + + + +一部の受信者が日本語が読めない環境にいる + + + + + +遠い外国ということでしょうか。 +けっこうどうしょうもありませんが、ウエブメールなら読める可能性が高いです。 +いずれにせよ読む側の問題なので fml8 で何かをすることは難しいでしょう。 + + + + + + + + + + +半角文字のメールが送られてきたらそれを矯正する + + + + + +未実装です。 + + + + + + + + + diff --git a/fml/doc/ja/tutorial/troubleshoot/recipes.sgml b/fml/doc/ja/tutorial/troubleshoot/recipes.sgml index 51360919..2d5618a0 100644 --- a/fml/doc/ja/tutorial/troubleshoot/recipes.sgml +++ b/fml/doc/ja/tutorial/troubleshoot/recipes.sgml @@ -1,5 +1,5 @@ @@ -72,6 +72,40 @@ fml + + + + +配送に失敗した記事を自動で再送したい + + + + + +MTA 間での再送エラーは MTA が再配送を試みます。 +Sendmail の歴史的なパラメータが五日間でしたので、 +五日間再配送を試みるくらいの MTA が多いと思います。 + + + +&fml8; と MTA 間でエラーが生じた場合は +&fml8; のメールキューに入り、 +&fml8; が MTA への再送を試みます。 +この部分の動作において &fml8; は MTA です。 + + + +参考: + + + +も参照して下さい。 + + + + + + @@ -173,3 +207,21 @@ rudo + + + + + + +flock が動かない OS なのですが? + + + + + +fml8 は flock(2) 必須ですので、fml8 は動きません(たぶん動くけど動作が +変になる)。 + + + + -- cgit v1.2.1