concept Linux & administration
Linux processes and PIDs
A Linux process has a PID and lifecycle. A child can exit before its parent collects the status; under ordinary retained-status rules, that unreaped child is a zombie.
What it means
A PID is the number used to identify a process. The parent–child relationship identifies which process created the child; it is separate from whether the child is still executing.
Here, reaping means collecting an exited child's termination status. Keeping execution and collection separate explains how a process can stop doing application work while a record of its exit remains.
Try it
Simulation: start with Child state = running and Parent collected status? = no. Change only Child state to exited, then select Compare with baseline to compare the results. After inspecting that contrast, keep exited selected and change Parent collected status? to yes to examine reaping. These are local teaching inputs; no real process is inspected or changed.
Explore process exit and reaping
Change one condition and inspect the computed result, its cause, and the model boundary.
Ordinary retained child-exit status: excludes ignored SIGCHLD, SA_NOCLDWAIT, reparenting, threads and namespaces.
Exit status cannot be collected before this child has exited.
| Input | Supplied value |
|---|---|
| Child state | running |
| Parent collected status? | no |
Synthetic local learning example. No account, real network, server, filesystem, credential, command or production change is accessed.
About this model
Ordinary retained child-exit status: excludes ignored SIGCHLD, SA_NOCLDWAIT, reparenting, threads and namespaces.
These are bounded teaching rules. Actual behavior needs the linked subject specifications and independent observations. The examples are not live checks.
The initial result is Running child: “Exit status cannot be collected before this child has exited.” The no input means status has not been collected; it is not, on its own, evidence of a zombie.
For the baseline-to-exit comparison, keep Parent collected status? = no. To isolate collection, manually observe exited/no and then exited/yes, keeping Child state = exited. Compare with baseline always uses running/no, even when the current state is exited/yes; it does not save exited/no as a new reference. Changing either input clears the displayed comparison. The manual before-and-after contrast and the fixed-baseline button answer different comparison questions.
Reset restores Child state to running and Parent collected status? to no, removes input errors and clears the comparison. It does not change which FAQ answers or the About this model panel you have opened or closed. There is no running clock or event history to reset.
How it works
In a typical fork/exec sequence, a successful fork creates a child with a distinct PID. Parent and child continue from the call, with different return values identifying their roles. If fork fails, no child is created.
The child can keep executing that program or use execve to replace it. A successful execve runs the replacement program in the same process: the PID stays the same. The interactive starts with an existing child; it does not simulate creation or program replacement.
In the ordinary case modeled here, exit and reaping are separate events. Exit ends the child's execution, but the kernel retains termination information so the parent can learn how the child finished. That retained, uncollected state is the zombie state.
When the parent collects the retained termination status through a wait interface, it reaps the child and removes the zombie state. Collection is therefore an accounting transition after execution has ended, not another way of stopping a running workload.
Both inputs matter. Parent collected status? = no describes the absence of collection, but it does not by itself establish a zombie: a running child also has no collected termination status. Only the combination of exit and retained, uncollected status supports that result under the stated assumptions.
Worked example
This is a synthetic baseline, not a captured process listing.
| Input | Baseline value |
|---|---|
| Child state | running |
| Parent collected status? | no |
The result is Running child. There is no termination status to collect yet, so the absence of collection is expected. This is the important intermediate condition: an uncollected status cannot be treated as a retained exit record until the child has actually exited.
What changes when the condition changes
Change Child state to exited while keeping Parent collected status? at no. The result becomes Exited; zombie status retained: “The child has exited but its termination status remains until reaped.” The missing condition in the baseline was exit—not simply the absence of collection.
Now keep Child state at exited and change Parent collected status? to yes. The result becomes Reaped; no zombie entry: “Collecting the exit status removes the zombie state.” This second contrast shows why exit does not imply a permanently retained entry. Collection changes the bookkeeping; it does not restart the child.
In practice
On a Linux host you are authorized to inspect, begin with a read-only observation of the one child process and its recorded parent. Read PID, state, parent and start information together, and record the observation time and host/boot context. For example, /proc/PID/stat reports a process start time relative to system boot. PIDs can be reused, so an old number alone is not reliable current identity evidence. Comparing this information is a diagnostic cross-check, not a race-free guarantee about a later action.
If the child is reported as a zombie, the expected interpretation is that execution has ended while termination information remains. The next question concerns collection by the parent; the listing alone does not explain why collection has not occurred. If the child is still running, the zombie explanation does not apply.
STOP before any intervention if the current identity, parent relationship or your authority is uncertain. Repeatedly signaling an already exited child does not address status collection. This page provides no termination, parent-restart or service-change procedure; those actions need a separately justified plan, impact assessment, verification and rollback.
Limits and unknowns
The simulation assumes ordinary retained child-exit status. It does not model explicitly ignored SIGCHLD, SA_NOCLDWAIT, reparenting, threads or namespaces. Its two Child state choices also do not reproduce scheduling behavior or explain every state shown by a process-inspection tool.
Child state = running together with Parent collected status? = yes is invalid: a running child cannot already have had its termination status collected. The interface shows an input error rather than a calculated outcome, and comparison is unavailable until you correct the combination or use Reset. It does not silently treat that combination as a reaped child.
A valid result establishes only what follows from your selected synthetic inputs. The simulation cannot determine the actual state of a process, its parent's wait behavior or your permissions on a real host. Without those observations, the real-machine explanation remains unknown. With JavaScript disabled, the initial example and article remain readable, but the interactive controls are unavailable.
What to carry forward
A zombie entry is evidence of ended execution with retained termination status, not continuing application work. Use that distinction to investigate status collection by the parent, while keeping process identity and permissions separate from any decision to intervene. The retained entry alone does not establish a parent defect or justify restarting a service.
Frequently asked questions
Editorial questions, answered from the sources listed for this article.
Is a zombie still executing application code?
No. A zombie has terminated; the remaining entry preserves information for collection. Its continued appearance in a process listing does not mean the application is still running.
Can the parent collect a running child’s termination status?
Not before the child exits: its termination status does not yet exist. Wait interfaces can report other selected state changes, but such a report is not the same as collecting termination status. This simulation models termination status only.
Does an exited child always remain a zombie?
No. Explicitly ignoring SIGCHLD or using SA_NOCLDWAIT can prevent retained zombie state. Those exceptions are outside this simulation. Consequently, the absence of a zombie entry alone does not prove that the parent collected termination status.
Can the same PID identify a different process later?
Yes. A PID can be reassigned after its earlier process is gone. Compare current identity and start information in the same host/boot context rather than relying on an old number. This helps interpret a saved listing; it does not provide a stable process handle or make a later intervention safe.
Sources & model boundaries
Primary references used for this explanation. The interactive example is an educational model, not a live check.
- Linux wait(2)
DESCRIPTION and NOTES: zombies, SIGCHLD and SA_NOCLDWAIT; DESCRIPTION; NOTES (zombies; explicit SIG_IGN / SA_NOCLDWAIT). Termination status collection and exceptions to retained zombie state; Ordinary exit status is retained until reaped; explicit SIGCHLD handling and SA_NOCLDWAIT qualify retention. The original model explicitly excludes those exceptions.
Checked .
- Linux credentials(7)
Process IDs; user and group identifiers. Process identity and effective credential context; not a live permission check
Checked .
- Linux fork(2)
DESCRIPTION; RETURN VALUE. A successful fork creates a child with its own PID; parent/child receive different return values. On failure, no child is created.
Checked .
- Linux execve(2)
DESCRIPTION; NOTES (no new process / unchanged PID). Successful execve replaces the program of the calling process rather than creating another process; PID remains unchanged.
Checked .
- Linux pidfd_send_signal(2)
NOTES — PID file descriptors. Numeric-PID operations can race when a terminated target PID is recycled; a PID file descriptor references a particular process. Cited only to establish reuse/race risk, not to prescribe a signal command.
Checked .
- Linux proc_pid_stat(5)
DESCRIPTION fields (1), (3), (4), (22). The file describes PID, state, PPID and starttime relative to boot; comparing observations is diagnostic reasoning, not a guarantee of future target identity.
Checked .