34 PROCESS GROUPS, SESSIONS, AND JOB CONTROL 699 34.1
Overview ................................................................................................................. 699
34.2
Process Groups ......................................................................................................... 701
34.3
Sessions ................................................................................................................... 704
34.4
Controlling Terminals and Controlling Processes............................................................ 706
34.5
Foreground and Background Process Groups ............................................................... 708
34.6
The SIGHUP Signal...................................................................................................... 709
34.6.1
Handling of SIGHUP by the Shell .............................................................. 710
34.6.2
SIGHUP
and Termination of the Controlling Process..................................... 712
34.7
Job Control............................................................................................................... 714
34.7.1
Using Job Control Within the Shell .......................................................... 714
34.7.2
Implementing Job Control....................................................................... 717
34.7.3
Handling Job-Control Signals ................................................................. 722
34.7.4
Orphaned Process Groups (and SIGHUP Revisited) ..................................... 725
34.8
Summary.................................................................................................................. 730
34.9
Exercises .................................................................................................................. 731