Supervisor: ログディレクトリが存在しない場合にクラッシュする

作成日 2015年07月03日  ·  4コメント  ·  ソース: Supervisor/supervisor

問題#120のコメントで報告さ

それがマスターブランチで何らかの形で解決されたかどうかはわかりませんが、バージョン3.1.1では、誰かが誤ってサーバーのログディレクトリを削除し、スーパーバイザーは単に動作を停止し、他のすべてのプログラムを使用しました。ログディレクトリがありません。

logging

最も参考になるコメント

fd22ca89ff353fbe92845e9d2517645e6cf149acで修正されました。 この修正はSupervisor3.2に含まれます。

これを複製して修正されることを確認する方法は次のとおりです。 最小限のsupervisord.conf

[supervisord]
logfile = /tmp/supervisord.log

[inet_http_server]
port = 127.0.0.1:9001

[supervisorctl]
serverurl = http://127.0.0.1:9001

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[program:cat]
command = /bin/cat
stdout_logfile = /thelogdir/foo.txt
autostart = false

ログディレクトリが存在する必要があります。存在しない場合、 supervisordは開始を拒否します。 ログディレクトリを作成し、その設定でフォアグラウンドでsupervisordを開始します。

$ mkdir /thelogdir
$ supervisord --version
3.2.0.dev0
$ supervisord -n -c /path/to/supervisord.conf
2015-08-18 14:38:52,503 INFO Increased RLIMIT_NOFILE limit to 1024
2015-08-18 14:38:52,516 INFO RPC interface 'supervisor' initialized
2015-08-18 14:38:52,516 CRIT Server 'inet_http_server' running without any HTTP authentication checking
2015-08-18 14:38:52,516 INFO supervisord started with pid 49508

supervisordがまだ実行されている間に、ログディレクトリを削除します。

$ rmdir /thelogdir

プロセスを開始してみてください:

$ supervisorctl -c /path/to/supervisord.conf 
cat                              STOPPED   Not started
supervisor> start cat
cat: ERROR (spawn error)
supervisor> status
cat                              FATAL     unknown error making dispatchers for 'cat': ENOENT

全てのコメント4件

私もこの振る舞いを見てイライラしました。 正しい動作は、可能であればlogdirを作成することであり、少なくとも他のタスクをクラッシュさせないようにする必要があると思います。

私もこの振る舞いを見てイライラしました。

いつ発生しますか? 元のコメントは具体的ではありません。 [program:x]セクションのstdout_logfileが存在しないログディレクトリを指定している場合、クラッシュは発生しますか? どのスーパーバイザーバージョンを使用していますか?

正しい動作は、可能であればlogdirを作成することだと思います

このような動作をする他のプログラムは使用していません。 supervisordは、ログディレクトリを自動的に作成するための十分な情報がありません。これは、ディレクトリを所有するユーザーやアクセス許可がわからないためです。 これらすべてのオプションを増やすことなく実行できる唯一のことは、ログディレクトリが存在しないときに明確なエラーメッセージを表示することだと思います。

少なくとも、他のタスクをクラッシュさせてはいけません

stdout_logfileまたはstderr_logfileが存在しないディレクトリを指定する[program:x]セクションを追加しても、 supervisordクラッシュしないことに同意します。

[program:x]セクションのstdout_logfileが存在しないログディレクトリを指定した場合、クラッシュは発生しますか? どのスーパーバイザーバージョンを使用していますか?

はい。 私にとって3.1.3のいくつかの問題。

fd22ca89ff353fbe92845e9d2517645e6cf149acで修正されました。 この修正はSupervisor3.2に含まれます。

これを複製して修正されることを確認する方法は次のとおりです。 最小限のsupervisord.conf

[supervisord]
logfile = /tmp/supervisord.log

[inet_http_server]
port = 127.0.0.1:9001

[supervisorctl]
serverurl = http://127.0.0.1:9001

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[program:cat]
command = /bin/cat
stdout_logfile = /thelogdir/foo.txt
autostart = false

ログディレクトリが存在する必要があります。存在しない場合、 supervisordは開始を拒否します。 ログディレクトリを作成し、その設定でフォアグラウンドでsupervisordを開始します。

$ mkdir /thelogdir
$ supervisord --version
3.2.0.dev0
$ supervisord -n -c /path/to/supervisord.conf
2015-08-18 14:38:52,503 INFO Increased RLIMIT_NOFILE limit to 1024
2015-08-18 14:38:52,516 INFO RPC interface 'supervisor' initialized
2015-08-18 14:38:52,516 CRIT Server 'inet_http_server' running without any HTTP authentication checking
2015-08-18 14:38:52,516 INFO supervisord started with pid 49508

supervisordがまだ実行されている間に、ログディレクトリを削除します。

$ rmdir /thelogdir

プロセスを開始してみてください:

$ supervisorctl -c /path/to/supervisord.conf 
cat                              STOPPED   Not started
supervisor> start cat
cat: ERROR (spawn error)
supervisor> status
cat                              FATAL     unknown error making dispatchers for 'cat': ENOENT
このページは役に立ちましたか?
0 / 5 - 0 評価