Skip to content
The Signal Belfry

/static/campanario/en/sino/sigchld/

Menu

SIG-009 · Stop and resume

SIGCHLD

A child has finished — the one notice parents may ignore guilt-free.

When a process terminates — or stops —, the kernel rings this bell for its parent. It is the mechanism behind every shell: the prompt only comes back because SIGCHLD announced the command was done.

It is one of the rare signals ignored by default. But ignoring does not collect the deceased: until the parent calls wait(), the child lingers as a zombie in the process table — Z in ps — holding only the exit status nobody came to fetch.

$ cat vigia.sh
#!/bin/bash
trap 'wait; echo "filho recolhido"' CHLD
./tarefa-longa &
sleep 60
$ ./vigia.sh
filho recolhido
The parent who waits raises no zombies.