Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

PID / PPID

Direct answer

Each process has a PID (process ID) and a PPID (its parent's PID). PID 1 is the init system. PIDs are reused after a process exits.

When to use this

Use it to find what started a process, or to target the right process when stopping it.

First 30 seconds

1. pgrep -a <name> — current PIDs.

2. ps -o ppid= -p <pid> → ps -p <ppid> -o cmd — who started it?

3. Service: systemctl show -p MainPID <unit>.

4. PID file matches? cat /run/<svc>.pid.

5. Act on the verified PID.

Operational verification

process created with a new PID → PPID records its parent → PID released at exit and may be reused

Evidence · next step

For Processes → PID / PPID, continue with the first unproven Topic check: Pair PID with process start time plus executable/cmdline before taking action. If that boundary is healthy, advance to the adjacent check: Capture PPID and process tree in the same PID namespace as the workload. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it to find what started a process, or to target the right process when stopping it.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

PID namespace → process creation → PID allocation + start time → PPID/ancestry → runtime identity checks → exit → PID reuse possibility

Healthy evidence: PID, start time, executable and PPID all correlate to the intended workload and are reacquired after lifecycle changes.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Pair PID with process start time plus executable/cmdline before taking action.

  • Capture PPID and process tree in the same PID namespace as the workload.
  • Validate stale PID-file or supervisor references against the live process identity.
  • After signal/restart actions, reacquire the new process identity instead of assuming the old PID remains valid.

Verification chain. PID namespace → process creation → PID allocation + start time → PPID/ancestry → runtime identity checks → exit → PID reuse possibility

Step 3 Commands Verify boundary
echo $$ ; echo $PPID
ps -o pid,ppid,cmd -p <pid>
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: a stale PID file or reused PID causes operators to inspect or signal the wrong process.

Step 5 Common mistakes Narrow the fault
  • Reusing stored PIDs after the process restarted.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

Do not rely on a stale PID file — the PID may now belong to another process. Use pgrep, systemctl show -p MainPID <unit> or pidof to get the current PID.

Key checks
  • ps -eo pid,ppid,user,stat,%cpu,%mem,etime,cmd --sort=-%cpu | head — processes by CPU with parent and state
  • pstree -p <pid> — process tree
  • top / htop — live CPU and memory
  • cat /proc/<pid>/status — state, threads and memory of one process
ReferenceWhat it is1 section · depth on demand

Core model

Never use PID alone as durable identity. Pair it with start time and executable/cmdline, and record the PID namespace when containers or namespace isolation are involved. For ancestry questions, verify the current PPID/process tree and account for reparenting when parents exit.

ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

PID/PPID evidence identifies a process relationship only for the captured namespace and lifetime, but it does not show service identity, health or persistence across restart.

Unit/cgroup identity belongs to systemd and container orchestration where applicable.

In depth

PIDs, parents, zombies and orphans

Every process has a PID and a parent PID (PPID). PID 1, systemd on most systems, is the ancestor of everything in user space. The wait(2) manual page explains what happens when processes end:

  • A terminated child that its parent hasn't yet waited for becomes a zombie. It occupies a slot in the kernel's process table until the parent collects its exit status.
  • If the parent exits first, its children are adopted by init, or by the nearest "subreaper" process, which then waits for them.
  • If a parent sets SIGCHLD to be ignored, its children don't become zombies at all.

Process relationships

TermMeaning
PIDThe process's own ID
PPIDThe parent's PID
Zombie (Z, <defunct>)Finished, with the exit status not yet collected by the parent
OrphanA running process whose parent has exited; re-parented to PID 1 or a subreaper
SubreaperA process that adopts orphaned descendants (systemd user managers, container inits)
Session / process groupGroups used by the terminal and by job control

Dealing with zombies

SituationAction
A few zombies that disappear quicklyNormal; nothing to do
Zombies accumulating under one parentA bug in the parent; restart it, or fix its child handling
Killing the zombieImpossible; it's already dead. Signal or restart the parent instead
A container's PID 1 not reapingUse an init such as tini, or docker run --init
host$ ps -o pid,ppid,stat,comm -p $$
    PID    PPID STAT COMMAND
   4410    4401 Ss   bash
host$ ps -eo pid,ppid,stat,comm | awk '$3 ~ /^Z/'
  9811    7702 Z    report-gen <defunct>
host$ ps -o pid,stat,etime,args -p 7702
    PID STAT     ELAPSED COMMAND
   7702 Sl    3-02:11:40 /usr/local/bin/scheduler --workers 8
host$ ps -eo ppid,stat | awk '$2 ~ /^Z/ {print $1}' | sort | uniq -c
    214 7702
host$ sudo systemctl restart scheduler
host$ pstree -sp $(pgrep -o sshd)
systemd(1)───sshd(842)

Reading the example

214 zombies all share the parent 7702. The scheduler starts report-gen children but never waits for them. Restarting the scheduler lets PID 1 adopt and reap the zombies. The real fix is in the scheduler's code. pstree -s shows a process's chain of ancestors back to PID 1.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

PID / PPID is part of Processes → PID / PPID. PID identifies a process within a PID namespace at a point in time, while PPID records its parent relationship; both are transient numeric references whose meaning depends on namespace and process lifetime.

Topic-specific state model. PID identifies a process within a PID namespace at a point in time, while PPID records its parent relationship; both are transient numeric references whose meaning depends on namespace and process lifetime.

Interpretation rule. - PID reused ≠ same process.

  • Same numeric PID in different PID namespaces ≠ same task.
  • PPID value ≠ immutable ancestry because reparenting can occur.
  • PID file contents ≠ evidence the referenced process is still the intended workload.

Quick reference

PID identifies a process; PPID its parent. PID 1 is systemd (or a container's init) and must reap orphaned children.

echo $$ $PPID
ps -o pid,ppid,cmd -p <pid>
ps --ppid 1 -o pid,cmd | head
cat /proc/sys/kernel/pid_max      # 4194304 on 64-bit systems
pgrep -P <ppid>                    # children

PIDs are reused after exit, so scripts should not trust old PID files blindly — check that /proc/<pid>/cmdline still matches. systemd tracks services by cgroup, not by PID files, which avoids this problem.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. PID/PPID evidence identifies a process relationship only for the captured namespace and lifetime, but it does not show service identity, health or persistence across restart.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. PID / PPID owns transient numeric process identifiers and parent relationships. Unit/cgroup identity belongs to systemd and container orchestration where applicable.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in Processes → PID / PPID. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://gitlab.com/procps-ng/procps · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
pid ppid linuxlinux process idparent process idpid reuse linux
Embedded reference data

Quick lookup tables

PID / PPID operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for PID / PPID.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective statePID identifies a process within a PID namespace at a point in time, while PPID records its parent relationship; both are transient numeric references whose meaning depends on namespace and process lifetime.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin host/container + timestamp → identify exact process or unit → capture PID plus start identity and cgroup/unit → resolve effective unit fragment + drop-ins → inspect dependency/order transaction → record systemd job result → verify process/cgroup and active/sub state → prove application readiness → repeat the original workload test.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainPID namespace → process creation → PID allocation + start time → PPID/ancestry → runtime identity checks → exit → PID reuse possibilityTrace requested/configured state through effective state to the observed workload result.
Failure boundaryPID/PPID evidence identifies a process relationship only for the captured namespace and lifetime; it does not prove service identity, health or persistence across restart.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux process/systemd evidence can establish this proof path: PID namespace → process creation → PID allocation + start time → PPID/ancestry → runtime identity checks → exit → PID reuse possibilityUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove behavior outside the captured process, manager, unit, dependency, runtime or application scope. PID/PPID evidence identifies a process relationship only for the captured namespace and lifetime; it does not prove service identity, health or persistence across restart.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven boundary: reacquire stable process identity, inspect effective loaded unit configuration and dependency/job state, correlate process/cgroup plus journal evidence, then run the original readiness/workload test before changing additional settings.Continue to the next unresolved boundary while preserving the original test condition.

PID / PPID · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryPID / PPID
Topic pathProcesses → PID / PPID
Runtime statePID identifies a process within a PID namespace at a point in time, while PPID records its parent relationship; both are transient numeric references whose meaning depends on namespace and process lifetime.
Fast checks- Pair PID with process start time plus executable/cmdline before taking action. - Capture PPID and process tree in the same PID namespace as the workload. - Validate stale PID-file or supervisor references against the live process identity. - After signal/restart actions, reacquire the new process identity instead of assuming the old PID remains valid.
Verification chainPID namespace → process creation → PID allocation + start time → PPID/ancestry → runtime identity checks → exit → PID reuse possibility Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary.
Failure boundaryPID/PPID evidence identifies a process relationship only for the captured namespace and lifetime; it does not prove service identity, health or persistence across restart. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?