問題タブ [process-monitoring]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - 複数のプロセスを監視し、終了した場合に新しいプロセスを開始する方法は?
Pythonスクリプトをデーモンとして実行し、いくつかの引数を異なるプロセスとして実行し、それらを継続的に監視したいと考えています。それらのいずれかが正常に終了した場合でも、エラーが発生した場合でも、新しい引数を使用して新しいプロセスを開始したいと考えています。
これにはpm2とそのnodejs APIを使用することを考えましたが、pm2 APIを使用してプロセスメッセージを監視する方法に関する有用な情報を見つけることができませんでした.
それを達成する方法はありますか?