制御端末とは何か?
制御端末とは、プロセスのセッションに結び付けられた端末デバイスで、その中のプロセスに対するジョブ制御とシグナル配送を仲介します。どのプロセスグループがフォアグラウンドにあるかを追跡し、割り込みなどキーボードで生成されたシグナルをそのグループへ送ります。制御端末から読み取ろうとするバックグラウンドの job は、フォアグラウンドに移されるまで停止させられます。
なぜ重要か
CI エージェントや daemon のように、いかなる制御端末からも切り離されたプロセスは、キーボードからのシグナルを受け取らず、shell が閉じても終了させられずに済みます。これを理解すると、スクリプト化された環境でのバックグラウンドとフォアグラウンドの挙動が明確になります。
関連ガイド
What Is a Pseudo Terminal?A pseudo terminal is a software pair that emulates a hardware terminal, letting programs that expect a termin…
What Is Job Control?Job control is the shell feature that lets you start, suspend, resume, and move commands between the foregrou…
What Is a Session Leader?A session leader is the process that creates a session, grouping process groups together and typically owning…