https://github.com/eepp/pidwrapnotify
notifier of Linux kernel PID wrapping
https://github.com/eepp/pidwrapnotify
Last synced: about 1 year ago
JSON representation
notifier of Linux kernel PID wrapping
- Host: GitHub
- URL: https://github.com/eepp/pidwrapnotify
- Owner: eepp
- Created: 2014-11-30T05:08:20.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-02T18:06:37.000Z (over 11 years ago)
- Last Synced: 2025-02-17T12:30:08.001Z (over 1 year ago)
- Language: C
- Size: 141 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
pidwrapnotify
=============
**pidwrapnotify** is a notifier of PID wrapping in Linux. A
kernel module notifies a user space daemon when the PID
wraps (that is, when a new process is created and its PID
is lower than the previous highest PID). The user space
daemon emits a D-Bus (standard) desktop notification when
this happens.
Original idea by [Simon Marchi](https://github.com/simark).
requirements
------------
* Linux >= 3.15
* `CONFIG_TRACEPOINT` and `CONFIG_MODULES` kernel options enabled
(both are enabled in pretty much all Linux distributions)
* incremental PID allocation, without PID reuse (default scheme)
using
-----
This might not work with old Linux kernels.
1. Clone the repository:
git clone https://github.com/eepp/pidwrapnotify.git && cd pidwrapnotify
2. Build the kernel module:
( cd module && make )
3. Insert the kernel module into the Linux kernel:
( cd module && sudo insmod ./pidwrapnotify.ko )
4. Look at the output of `dmesg` to find the character
device's major number, e.g.:
[ 5256.923685] pidwrapnotify: added char device 249:0
5. Create the character special file using this major number:
sudo mknod /dev/pidwrapnotify c 249 0
6. Install the daemon (make sure you have the
`python-dbus` package for Python 3):
( cd daemon && sudo ./setup.py install )
7. Start the daemon:
pidwrapnotifyd
8. Enjoy.
Here's a simple way to make your system's PID wrap
quickly:
while true; do ls; done
Of course, the actual time depends on this value:
cat /proc/sys/kernel/pid_max