46 lines
2.2 KiB
Markdown
Raw Normal View History

2025-09-26 13:56:55 +02:00
# rproc - A Zero-Configuration Process Manager
**Authored by:** retoor
**Version:** 1.1
**Date:** 2025-09-26
---
## 1. Overview
**rproc** is a lightweight, file-based, and zero-configuration process manager designed for simplicity and robustness. It monitors a single directory, treating the presence, absence, and modification of executable shell scripts (`.sh` files) as the source of truth for managing long-running processes.
Its design is predicated on providing a resilient service management layer with minimal operational overhead.
### Key Advantages
* **Simplicity and Intuitiveness:** No complex commands, APIs, or configuration files are required. Process management is performed using standard shell commands (`touch`, `rm`, `mv`, `chmod`), making it immediately accessible.
* **Extreme Resource Efficiency:** As a compiled C binary using event-driven I/O (`inotify`, `select`), `rproc` has a negligible memory and CPU footprint. It consumes system resources only when actively handling a file event or a process state change.
* **High Portability:** The application is a single, self-contained executable with no external dependencies beyond the standard C library. This allows it to be deployed on nearly any modern Linux system without an installation procedure.
* **GitOps-Friendly Workflow:** Because the desired state of all processes is defined by files on disk, `rproc` integrates perfectly with version control systems. Managing services can be as simple as a `git pull` in the working directory to automatically add, remove, or restart processes based on the committed changes.
---
## 2. Core Concepts
The fundamental principle of `rproc` is that the state of the executable `.sh` files in its working directory directly represents the desired state of the managed processes.
- **To run a process:** Create an executable `.sh` file.
- **To stop a process:** Delete the `.sh` file.
- **To restart a process:** Modify the `.sh` file.
`rproc` uses the Linux `inotify` subsystem to watch for these file system events in real-time and acts accordingly.
---
## 3. Installation
`rproc` is a single-file C application.
### Compilation
Compile the source code using a standard C compiler like GCC:
```bash
gcc -Wall -Wextra -O2 -std=c11 -o rproc rproc.c