Content deleted Content added
Stevebroshar (talk | contribs) →Control: It's user interface |
Stevebroshar (talk | contribs) →Signals: Add intro sentence for section |
||
Line 53:
==Signals==
{{Unreferenced section|date=February 2020}}
The [[interprocess communication]] of job control is implemented via [[Unix signal |signal]]s.
Typically, a shell maintains information about background jobs in a job table. When an [[login session |interactive session]] ends (i.e. user [[logout |logs out]]), the shell sends [[signal (computing)|signal]] [[SIGHUP]] to all jobs, and waits for the process groups to exit before terminating itself. Some shells provide a non-POSIX command [[Disown (Unix)|<code>disown</code>]] that removes a job from the job table. The process group becomes an [[orphan process |orphan]]. The shell will not send it SIGHUP, nor wait for it to terminate. This is one technique for enabling a process as a [[daemon (computer software)|daemon]]; owned direclty by the root process [[init]]. The POSIX command [[nohup |{{code |nohup}}]] provides an alternate way to prevent a job from being terminated by the shell.▼
▲Typically, a shell maintains information about background jobs in a job table. When an [[login session |interactive session]] ends (i.e. user [[logout |logs out]]), the shell sends
Suspending the foreground job (via {{keypress |Ctrl |Z}}) sends signal SIGTSTP (terminal stop) to the processes of the group. By default, this signal causes a process to pause so that the shell can resume. However, a process can ignore the signal. A process can also be paused via signal SIGSTOP (stop), which cannot be ignored.
|