{"id":13436843,"url":"https://github.com/orhun/zps","last_synced_at":"2025-08-29T06:05:41.428Z","repository":{"id":37735259,"uuid":"210154784","full_name":"orhun/zps","owner":"orhun","description":"A small utility for listing and reaping zombie processes on GNU/Linux.","archived":false,"fork":false,"pushed_at":"2024-01-19T21:22:53.000Z","size":626,"stargazers_count":207,"open_issues_count":3,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-14T17:48:28.778Z","etag":null,"topics":["gnu-linux","linux","linux-utility","process-management","unix","zombie-processes"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orhun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"orhun","patreon":"orhunp","custom":["https://www.buymeacoffee.com/orhun"]}},"created_at":"2019-09-22T13:47:55.000Z","updated_at":"2025-05-25T20:04:29.000Z","dependencies_parsed_at":"2024-01-23T18:12:53.727Z","dependency_job_id":"cead7929-32ac-45a3-a40f-79f1e5bffebe","html_url":"https://github.com/orhun/zps","commit_stats":{"total_commits":305,"total_committers":7,"mean_commits":43.57142857142857,"dds":0.09180327868852456,"last_synced_commit":"503a11006a74e4ce0aecdbfcaad4ed9afc7add46"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/orhun/zps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fzps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fzps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fzps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fzps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orhun","download_url":"https://codeload.github.com/orhun/zps/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhun%2Fzps/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272640003,"owners_count":24968559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gnu-linux","linux","linux-utility","process-management","unix","zombie-processes"],"created_at":"2024-07-31T03:00:52.516Z","updated_at":"2025-08-29T06:05:41.353Z","avatar_url":"https://github.com/orhun.png","language":"C","readme":"![Logo](https://user-images.githubusercontent.com/24392180/66733887-b52b4780-ee69-11e9-86ee-ab04caf98287.png)\n\n# zps [![Release](https://img.shields.io/github/release/orhun/zps.svg?color=590000\u0026style=flat-square)](https://github.com/orhun/zps/releases)\n\n### A small utility for listing and reaping zombie processes on GNU/Linux.\n\n![zps](assets/demo-top.gif)\n\n[![Build](https://img.shields.io/github/actions/workflow/status/orhun/zps/ci.yml?color=black\u0026style=flat-square)](https://github.com/orhun/zps/actions?query=workflow%3A%22Continuous+Integration%22)\n[![Docker Build](https://img.shields.io/github/actions/workflow/status/orhun/zps/docker.yml?color=black\u0026style=flat-square\u0026label=docker)](https://github.com/orhun/zps/actions?query=workflow%3A%22Docker+Automated+Builds%22)\n[![Codacy](https://img.shields.io/codacy/grade/3d40a551806b4c788befba6d2920675b.svg?color=black\u0026style=flat-square)](https://www.codacy.com/manual/orhun/zps?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=orhun/zps\u0026utm_campaign=Badge_Grade)\n[![Codecov](https://img.shields.io/codecov/c/github/orhun/zps?color=black\u0026style=flat-square)](https://codecov.io/gh/orhun/zps)\n[![Stars](https://img.shields.io/github/stars/orhun/zps.svg?color=590000\u0026style=flat-square)](https://github.com/orhun/zps/stargazers) [![License](https://img.shields.io/github/license/orhun/zps.svg?color=590000\u0026style=flat-square)](./LICENSE)\n\nOn Unix and Unix-like computer operating systems, a [zombie process](https://en.wikipedia.org/wiki/Zombie_process) or defunct process is a process that has completed execution (via the [exit](\u003chttps://en.wikipedia.org/wiki/Exit_(system_call)\u003e) system call) but still has an entry in the process table. This occurs for child processes, where the entry is still needed to allow the parent process to read its child's exit status: once the exit status is read via the [wait](\u003chttps://en.wikipedia.org/wiki/Wait_(system_call)\u003e) system call, the zombie's entry is removed from the process table and it is said to be \"reaped\".\n\nUnlike the normal processes, zombie processes cannot be removed from a system with the [kill](\u003chttps://en.wikipedia.org/wiki/Kill_(command)\u003e) command since they are already dead. (This is where the term's metaphor [zombie - an undead person] comes from.) To reap a zombie process, `SIGCHLD` signal can be sent to the parent process manually using the [kill](\u003chttps://en.wikipedia.org/wiki/Kill_(command)\u003e) command. If the parent process refuses to reap the zombie, then terminating the parent process (mostly with `SIGTERM` signal) can be an option. When a child process loses its parent, [init](https://en.wikipedia.org/wiki/Init) process becomes its new parent and it will reap any zombies since it executes the [wait](\u003chttps://en.wikipedia.org/wiki/Wait_(system_call)\u003e) system call periodically.\n\nZombie processes are not harmful since they are not affecting other processes or using any system resources. However, they do retain their [process ID](https://en.wikipedia.org/wiki/Process_identifier). This can lead to preventing new processes to launch if all the available PIDs were assigned to zombie processes. Considering Unix-like systems have a finite number of process IDs (`/proc/sys/kernel/pid_max`), it's one of the problems that zombie processes can cause. Another danger of zombie processes is that they can cause [resource leak](https://en.wikipedia.org/wiki/Resource_leak) if they stay as a zombie in the process table for a long time. Apart from these issues, having a few zombie processes won't be a big deal for the system although they might indicate a bug with their parent process.\n\n[zproc.c](https://github.com/orhun/zps/blob/master/example/zproc.c) file can be compiled and run to see how zombie processes are created.\n\n```\ncd example/ \u0026\u0026 gcc -O3 -Wall zproc.c -o zproc \u0026\u0026 ./zproc\n```\n\n**zps** aims to list the running processes at a particular time with stats and indicate the zombie processes on this list. It can also reap these zombie processes automatically based on the arguments provided (by default using `SIGTERM`). See [usage](https://github.com/orhun/zps#usage) for more information.\nTechnically, **zps** reads process stats from [/proc](https://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/proc.html) filesystem and uses [C POSIX library](https://en.wikipedia.org/wiki/C_POSIX_library) to handle listing, sending signals and other operations.\n\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n- [Installation](#installation)\n  - [Arch Linux](#arch-linux)\n  - [Alpine Linux](#alpine-linux)\n  - [Fedora Linux](#fedora-linux)\n  - [CMake](#cmake)\n  - [Make](#make)\n  - [GCC](#gcc)\n  - [Docker](#docker)\n    - [Building an image](#building-an-image)\n    - [Running the image in container](#running-the-image-in-container)\n- [Usage](#usage)\n  - [zps -r](#zps--r--reap)\n  - [zps -s](#zps--s--signal)\n  - [zps -p](#zps--p--prompt)\n  - [zps -q](#zps--q--quiet)\n  - [zps -n](#zps--n--no-color)\n- [TODO(s)](#todos)\n- [License](#license)\n- [Copyright](#copyright)\n\n\u003c!-- vim-markdown-toc --\u003e\n\n\u003c/details\u003e\n\n## Installation\n\n### Arch Linux\n\n```\npacman -S zps\n```\n\n### Alpine Linux\n\n```\napk add zps\n```\n\n### Fedora Linux\n\n```\ndnf install zps\n```\n\n### CMake\n\n```\nmkdir -p build \u0026\u0026 cd build\ncmake ../ -DCMAKE_INSTALL_PREFIX=/usr\nmake\nsudo make install\nsudo ldconfig\n```\n\n### Make\n\n```\nmake\nsudo make install\n```\n\n### GCC\n\nWith manual compilation, you might want to also pass\n`-DNDEBUG` to disable runtime assertions.\n\n```\ncd src/ \u0026\u0026 gcc -s -O3 -Wall -Wextra -pedantic zps.c -o zps\n```\n\n### Docker\n\n#### Building an image\n\n```\ndocker build -f docker/Dockerfile -t zps .\n```\n\n#### Running the image in container\n\n```\ndocker run zps\n```\n\n## Usage\n\n```\nUsage:\n  zps [options]\n\nOptions:\n  -v, --version        show version\n  -h, --help           show help\n  -a, --all            list all user-space processes\n  -r, --reap           reap zombie processes\n  -s, --signal   \u003csig\u003e signal to be used on zombie parents\n  -p, --prompt         show prompt for selecting processes\n  -q, --quiet          reap in quiet mode\n  -n, --no-color       disable color output\n```\n\n### zps -r/--reap\n\n![zps -r](assets/demo-reap.gif)\n\n### zps -s/--signal\n\n![zps -s](assets/demo-signal.gif)\n\n### zps -p/--prompt\n\n![zps -p](assets/demo-prompt.gif)\n\n### zps -q/--quiet\n\n![zps -q](assets/demo-quiet.gif)\n\n### zps -n/--no-color\n\n![zps -n](assets/demo-no-color.gif)\n\n## License\n\nGNU General Public License v3.0 only ([GPL-3.0-only](https://www.gnu.org/licenses/gpl.txt))\n\n## Copyright\n\nCopyright © 2019-2024, [Orhun Parmaksız](mailto:orhunparmaksiz@gmail.com)\n","funding_links":["https://github.com/sponsors/orhun","https://patreon.com/orhunp","https://www.buymeacoffee.com/orhun"],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forhun%2Fzps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forhun%2Fzps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forhun%2Fzps/lists"}