Do-Not-Disturb process enforcer — kill processes from unauthorized users on shared machines
Project description
dnd — Do Not Disturb
Process enforcer for shared machines. Monitors running processes and kills anything owned by users who aren't on the allowed list. Designed for honor-code reservation systems where some users don't follow the rules.
Quick start
No install needed — run directly with uvx:
# Allow everyone by default, block specific users:
uvx dnd-daemon allow '*'
uvx dnd-daemon block debopman
# Start the daemon (foreground, for testing):
uvx dnd-daemon run --dry-run
# Start for real:
uvx dnd-daemon run
Install
For persistent use, install globally with uv:
uv tool install dnd-daemon
Then use dnd directly:
dnd allow '*'
dnd block debopman
dnd run
Alternatively, install with pip:
pip install dnd-daemon
Commands
| Command | Description |
|---|---|
dnd run |
Start the enforcement daemon |
dnd allow <users...> |
Add users to the allowed list (also unblocks them) |
dnd block <users...> |
Add users to the blocked list (also removes from allowed) |
dnd list |
Show current allowed and blocked users |
dnd install |
Install as a systemd service (requires sudo) |
dnd uninstall |
Remove the systemd service (requires sudo) |
dnd status |
Show systemd service status |
dnd run options
--dry-run— log what would be killed without actually killing--daemon— fork into background--interval N— seconds between scans (default: 10)--verbose— debug-level logging
Wildcards
Use * in the allowed list to allow everyone by default. The blocked list
always takes priority over the wildcard:
dnd allow '*' # everyone is allowed
dnd block baduser # ...except baduser
Configuration
User lists are stored in ~/.cache/dnd/:
~/.cache/dnd/
allowed_users.txt
blocked_users.txt
dnd.log
Override with --allow-config and --block-config:
dnd --allow-config /path/to/allowed.txt list
Systemd service
sudo dnd install # creates, enables, and starts the service
sudo dnd uninstall # stops, disables, and removes the service
dnd status # show service status
The service runs as the installing user with CAP_KILL for permission to
terminate other users' processes. Config changes via dnd allow / dnd block
are automatically picked up (the daemon reloads on SIGHUP).
How it works
- Scans
/procevery 10 seconds for all running processes - Skips system/service accounts (UID <= 999, known service names)
- Checks each remaining process owner against the allowed/blocked lists
- Sends SIGTERM, waits 5 seconds, then SIGKILL if still alive
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dnd_daemon-0.0.1.tar.gz.
File metadata
- Download URL: dnd_daemon-0.0.1.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e1f3fc260f8de6419d4f6de1f9f63f2034368cdc424ccb021c3b34039938c78
|
|
| MD5 |
dd3f3d5d7d7929169f737ef18f51e353
|
|
| BLAKE2b-256 |
66e423bf03825212b4e43d0372063a000f51875c8d701df51f862a8b47d43ef1
|
Provenance
The following attestation bundles were made for dnd_daemon-0.0.1.tar.gz:
Publisher:
publish.yml on AgrawalAmey/dnd-daemon
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dnd_daemon-0.0.1.tar.gz -
Subject digest:
3e1f3fc260f8de6419d4f6de1f9f63f2034368cdc424ccb021c3b34039938c78 - Sigstore transparency entry: 1189873529
- Sigstore integration time:
-
Permalink:
AgrawalAmey/dnd-daemon@85a003a423df3115632c42cffdbde9c66eca4043 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/AgrawalAmey
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@85a003a423df3115632c42cffdbde9c66eca4043 -
Trigger Event:
release
-
Statement type:
File details
Details for the file dnd_daemon-0.0.1-py3-none-any.whl.
File metadata
- Download URL: dnd_daemon-0.0.1-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d51935ee41ccc836c2ec6b8bfc58ba10e2692085f31520808bc70404fe0efbf
|
|
| MD5 |
04cb27039f923ae8bcd8ae5c8cba8af9
|
|
| BLAKE2b-256 |
c3d8d5f6c29464e24ef6f3564b2c749582fa3334fcad285c63294a7f587adedb
|
Provenance
The following attestation bundles were made for dnd_daemon-0.0.1-py3-none-any.whl:
Publisher:
publish.yml on AgrawalAmey/dnd-daemon
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dnd_daemon-0.0.1-py3-none-any.whl -
Subject digest:
2d51935ee41ccc836c2ec6b8bfc58ba10e2692085f31520808bc70404fe0efbf - Sigstore transparency entry: 1189873532
- Sigstore integration time:
-
Permalink:
AgrawalAmey/dnd-daemon@85a003a423df3115632c42cffdbde9c66eca4043 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/AgrawalAmey
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@85a003a423df3115632c42cffdbde9c66eca4043 -
Trigger Event:
release
-
Statement type: