ジョブ制御とは?
ジョブ制御は、コマンドやパイプラインを 1 つのジョブにまとめ、それを一時停止、再開したり、フォアグラウンドでの実行とバックグラウンドでの実行を切り替えたりできるようにするシェルの機能群です。シェルはこれをプロセスグループと制御端末を通じて調整します。これにより、1 つの対話セッションで複数の実行中コマンドを扱えます。
なぜ重要か
CI のシェルは通常、ジョブ制御を無効にして非対話的に実行され、これによりシグナルがバックグラウンドプロセスに届く方法が変わります。これを知っておくと、バックグラウンドに回したステップが、対話プロンプトとスクリプトとで異なる動作をする理由がわかります。
関連ガイド
What Is a Controlling Terminal?A controlling terminal is the terminal associated with a session that delivers keyboard signals and identifie…
What Is a Process Group?A process group is a set of related processes that can be signaled together, used by shells to manage all the…
What Is a Background Process?A background process runs without holding the foreground of a shell, letting the shell accept other commands…