All Projects → orhun → zps

orhun / zps

Licence: GPL-3.0 License
A small utility for listing and reaping zombie processes on GNU/Linux.

Programming Languages

c
50402 projects - #5 most used programming language
shell
77523 projects
Makefile
30231 projects
Dockerfile
14818 projects
CMake
9771 projects

Projects that are alternatives of or similar to zps

La Capitaine Icon Theme
La Capitaine is an icon pack designed to integrate with most desktop environments. The set of icons takes inspiration from the latest iterations of macOS and Google's Material Design.
Stars: ✭ 1,858 (+1329.23%)
Mutual labels:  gnu-linux
KDynamic
An Alternative to MacOS Mojave Dynamic Theme and Wallpaper Changer
Stars: ✭ 48 (-63.08%)
Mutual labels:  gnu-linux
cati
Cati Unix Package Manager
Stars: ✭ 19 (-85.38%)
Mutual labels:  gnu-linux
Something For Reddit
A Reddit Client For GNOME (with Gtk+ and Python)
Stars: ✭ 151 (+16.15%)
Mutual labels:  gnu-linux
Automate With Ansible
《現代 IT 人一定要知道的 Ansible 自動化組態技巧》
Stars: ✭ 188 (+44.62%)
Mutual labels:  gnu-linux
Mis-Comandos-Linux
📋 Lista descrita de mis 💯 comandos favoritos ⭐ en GNU/Linux 💻
Stars: ✭ 28 (-78.46%)
Mutual labels:  gnu-linux
Squeezer
Flexible general-purpose compressor with a touch of citrus
Stars: ✭ 78 (-40%)
Mutual labels:  gnu-linux
Breath OS
An OS for breathing? My DIY OS
Stars: ✭ 17 (-86.92%)
Mutual labels:  gnu-linux
Pkgtop
Interactive package manager and resource monitor designed for the GNU/Linux.
Stars: ✭ 222 (+70.77%)
Mutual labels:  gnu-linux
Ubuntu-TW-Ubuntu
台灣社群非官方客製版 Ubuntu 作業系統
Stars: ✭ 26 (-80%)
Mutual labels:  gnu-linux
Photoshopcclinux
Photoshop CC v19 installer for Gnu/Linux
Stars: ✭ 2,894 (+2126.15%)
Mutual labels:  gnu-linux
Flameshot
Powerful yet simple to use screenshot software 🖥️ 📸
Stars: ✭ 15,429 (+11768.46%)
Mutual labels:  gnu-linux
K-Meter
Implementation of a K-System meter according to Bob Katz' specifications
Stars: ✭ 66 (-49.23%)
Mutual labels:  gnu-linux
Rofi
A large collection of Rofi based custom Menu, Applets, Launchers & Powermenus.
Stars: ✭ 2,907 (+2136.15%)
Mutual labels:  gnu-linux
god
Linux utility for simplifying the Git usage.
Stars: ✭ 26 (-80%)
Mutual labels:  linux-utility
Kindd
A kindful dd, written in qt-quick.
Stars: ✭ 93 (-28.46%)
Mutual labels:  gnu-linux
dotfiles
Config files for my linux rice
Stars: ✭ 60 (-53.85%)
Mutual labels:  gnu-linux
vasisualy
Vasisualy it's a simple Russian voice assistant written on Python for GNU/Linux, Windows and Android.
Stars: ✭ 33 (-74.62%)
Mutual labels:  gnu-linux
bash-streams-handbook
💻 Learn Bash streams, pipelines and redirection, from beginner to advanced.
Stars: ✭ 153 (+17.69%)
Mutual labels:  gnu-linux
tr
linux memory hacking library
Stars: ✭ 25 (-80.77%)
Mutual labels:  gnu-linux

Logo

zps Release

A small utility for listing and reaping zombie processes on GNU/Linux.

zps

Travis Build Docker Build Codacy Codecov Stars License

On Unix and Unix-like computer operating systems, a zombie process or defunct process is a process that has completed execution (via the exit 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 system call, the zombie's entry is removed from the process table and it is said to be "reaped".

Unlike the normal processes, zombie processes cannot be removed from a system with the kill 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 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 process becomes its new parent and it will reap any zombies since it executes the wait system call periodically.

Zombie processes are not harmful since they are not affecting other processes or using any system resources. However, they do retain their process ID. 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 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.

zproc.c file can be compiled and run to see how zombie processes are created.

cd example/ && gcc -O3 -Wall zproc.c -o zproc && ./zproc

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 if --reap argument is provided. There's also --lreap argument for reaping zombie processes after listing. See usage for more information.
Technically, zps reads process stats from /proc filesystem and uses C POSIX library to handle listing, sending signals and other operations.

Installation

Arch Linux

pacman -S zps

CMake

mkdir -p build && cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
sudo ldconfig

Make

make
sudo make install

GCC

cd src/ && gcc -s -O3 -Wall -Wextra -pedantic zps.c -o zps

Docker

Building an image

docker build -f docker/Dockerfile -t zps .

Running the image in container

docker run zps

Usage

Usage:
  zps [options]

Options:
  -r, --reap      reap zombie processes
  -x, --lreap     list and reap zombie processes
  -l, --list      list zombie processes only
  -p, --prompt    show prompt for selecting processes
  -f, --fd <num>  set maximum file descriptors (default: 15)
  -s, --silent    run in silent mode
  -v, --version   show version
  -h, --help      show help

zps -r

zps -r

zps -x

zps -x

zps -l

zps -l

zps -p

zps -p

TODO(s)

  • Improve listing processes for long process names.
  • Send SIGCHLD signal to the parent instead of terminating it.

License

GNU General Public License v3.0 only (GPL-3.0-only)

Copyright

Copyright © 2019-2022, Orhun Parmaksız

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].