長期実行プロセスとデーモンプロセスの違いは何ですか?

長期実行プロセスとデーモンプロセスの違いは何ですか?

使ってみよう永遠に私のnodejsスクリプトを実行し続ける

フォーエバーのホームページによると

  [Long Running Process]
    The forever process will continue to run outputting log messages to the console.
    ex. forever -o out.log -e err.log my-script.js

  [Daemon]
    The forever process will run as a daemon which will make the target process start
    in the background. This is extremely useful for remote starting simple node.js scripts
    without using nohup. It is recommended to run start with -o -l, & -e.
    ex. forever start -l forever.log -o out.log -e err.log my-daemon.js
        forever stop my-daemon.js

しかし、私は2つの違いを理解できません。どのような条件でデーモンの代わりに長期実行プロセスを使用する必要がありますか?

ベストアンサー1

違いはwill continue to run outputting log messages to the console部品にあります。デーモンは、最初に起動したコンソールへの参照を持たない長期実行プロセスです。

参照を削除するには、「分離」と呼ばれる追加の手順(元の入出力ファイル記述子を閉じる)が必要です。

おすすめ記事