Skip to content

toshsan/supervisors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Supervisors

A Multi Process Supervisor written in Rust

A lightweight process supervisor written in Rust. Inspired by Supervisord, this tool allows you to manage and monitor long-running background processes with optional file-based logging and a simple HTTP API.


✨ Features

  • Start and monitor multiple child processes
  • Automatically restart processes if they crash (autorestart)
  • Log output to files or fallback to terminal
  • Health and status HTTP API (/health, /status)
  • Configuration via a simple TOML file

📦 Requirements

  • Rust (edition 2024+)
  • Unix-like OS (Linux, macOS)

🚀 Getting Started

Install

Install from source or github release

Create a supervisors.conf config file

[programs.echo] command = "echo" args = ["I run forever in a loop"] autorestart = true

run

supervisors

1. Clone & Build

git clone https://github.com/toshsan/supervisors.git
cd supervisors
cargo build --release

Great question. Here's a rational, developer-focused comparison for why you'd build or use This Rust-based supervisor instead of existing tools like Supervisor, systemd, or Docker:


🤔 Why did i build this or Why would you use this instead of alternatives?

🔍 1. I Need a Lightweight, Portable Supervisor

Tool Dependencies Portability
Supervisor Python, config files Unix only
systemd Requires system init Linux only
Docker Daemon + images OS-agnostic, but heavy
✅ supervisors Standalone binary Cross-platform, no runtime deps

This Docker friendly supervisor compiles to a single binary, runs on any platform with zero dependencies, and doesn't rely on system init processes.


💡 2. Simple Config, Simple API

  • Supervisord depends on python and has bunch of dependencies. CPU & Memory usage is usually higher than desired.
  • Docker requires image building, volumes, and orchestration
  • systemd is powerful but complex and Linux-specific

✅ This tool uses:

  • TOML configs (friendly, human-readable)
  • Minimal HTTP API (/status, /health)
  • Easy log configuration per process

Perfect for use cases like:

  • Embedded systems
  • Developer tooling
  • Internal process orchestration
  • Test runners
  • Custom deployment pipelines

⚡ 3. Fast, Concurrent, Safe — It’s Rust

Rust gives you:

  • True concurrency using tokio (unlike Python's GIL-bound Supervisor)
  • Memory safety and strong typing
  • Low overhead, perfect for running long-lived daemons

You’re not building a general-purpose system init — you're creating a focused, embeddable process runner.


🧩 4. Extensibility Without Complexity

This implementation is modular:

  • Add status APIs, dashboards, WebSockets, gRPC, etc.
  • Embed it into other Rust apps
  • Use it as a library or CLI

Try that with systemd 😉


🚫 When Not to Use This

To be fair, this is not yet a full replacement for:

  • systemd if you're managing critical system services (with dependencies, sockets, targets, etc.)
  • Docker if you need full process isolation, volume sharing, or container orchestration
  • Supervisor if you're already deeply invested in its ecosystem and XML-RPC control

✅ Use This If You Want:

  • A lightweight, custom supervisor with full Rust control
  • Embeddable process monitoring in a Rust project
  • Reliable restarts and logs without external services
  • Simplicity over over-engineering

About

A lightweight process supervisor written in Rust. Supervisord alternative.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages