
CS485G Spring 2015 44
2. Lecture 27, 4/6/2015
3. login starts a shell for each logged-in user.
(a) sh: original shell, Stephen Bourne, 1977
(b) csh: BSD Unix C shell. tcsh: enhanced at CMU.
(c) bash: Bourne-again shell.
(d) ash: Almquist shell, 1997 dash: POSIX standard.
4. The shell runs a read-eval loop.
(a) Primarily it runs commands as processes (using fork() and
exec().
(b) It waits for commands to finish (using wait()), or not, if they
have been started in the background.
(c) A user has a limited number of processes (built-in limit com-
mand)
50 Signals
1. When a process terminates, the kernel sends its parent a software
interrupt.
2. Software interrupts are called signals.
3. There are about 30 possible signals, each with a different purpose.
see signal(7).
4. Each signal has its default action. For instance, SIGSEGV terminates
with a dump file; SIGCHLD (a child has stopped or terminated) is
ignored.
5. A process may explicitly send a signal to another process by the
kill(2) system call. The sending and target processes must be
owned by the same user, or the sending process must be owned by
root.
6. The /bin/kill command sends a given signal to a given target process
(or process group).
7. The user can send signals to processes by some keyboard methods:
ctrl-c sends SIGINT; ctrl-z sends SIGSTOP.
8. For most signals, a process can choose in advance what action to take
when receiving them, but using signal(2).
Comentários a estes Manuais