process-cleanup
Process Cleanup
Detect and reap zombie processes using /bin/ps.
Background
A zombie (state Z) is a process that has exited but whose parent hasn't called wait() to collect its exit status. Zombies consume no CPU or memory, but they hold a PID slot and can accumulate. You can't kill a zombie — it's already dead. The only remedies are:
- Signal the parent with
SIGCHLDso it reaps the child - Kill the parent so
init/launchdadopts and reaps the orphan
Important: use ps for process state queries
Always use ps (BSD) for process state queries. If ps is aliased, use /bin/ps to bypass it.
# List zombies
/bin/ps ax -o pid,state,ppid,user,command | awk '$2 ~ /Z/'
More from paulrberg/agent-skills
code-simplify
This skill should be used when the user asks to "simplify code", "clean up code", "refactor for clarity", "reduce complexity", "improve readability", "make this easier to maintain", or asks to simplify recently modified code.
1.7Kcode-review
This skill should be used when the user asks to "review code", "review PR", "code review", "audit code", "check for bugs", "security review", "review my changes", "find issues in this code", "review the diff", or asks for pull request review or code audit.
1.5Kcli-gh
This skill should be used when the user mentions "gh CLI", "gh command", asks to "view repository info", "trigger workflows", "search GitHub", "manage codespaces", "check PR status", "list issues", "browse repo", or asks about GitHub CLI usage and automation from the command line.
1.4Keffect-ts
This skill should be used when the user asks about Effect-TS patterns, services, layers, error handling, service composition, or writing/refactoring code that imports from 'effect'. Also covers Effect + Next.js integration with @prb/effect-next.
1.4Kcode-polish
This skill should be used when the user asks to "polish code", "simplify and review", "clean up and review code", "full code polish", "simplify then review", "refactor and review", "simplify and fix", "clean up and fix", or wants a combined simplification and review workflow on recently changed code.
1.3Ktailwind-css
This skill should be used when the user asks to style with Tailwind v4, add or fix Tailwind classes, use tailwind-variants or tw-animate-css, or configure Tailwind. Trigger phrases include "style with Tailwind", "fix Tailwind styles", "configure Tailwind v4", "migrate to Tailwind v4".
1.3K