systemg
Systemg - A Lightweight Process Manager
Systemg is a simple, fast, and dependency-free process manager written in Rust.
It aims to provide a minimal alternative to systemd and other heavyweight service managers, focusing on ease of use, clarity, and performance.
Why Systemg?
Traditional process managers like systemd are complex, heavy, and introduce unnecessary dependencies.
Systemg offers a lightweight, configuration-driven solution that's easy to set up and maintain.
Features
- Declarative YAML Configuration - Define services, dependencies, and restart policies easily.
- Automatic Process Monitoring - Restart crashed services based on custom policies.
- Dependency-Aware Startup - Honour
depends_onchains, skip unhealthy dependencies, and cascade stop dependents on failure. - Environment Variable Support - Load variables from
.envfiles and per-service configurations. - Minimal & Fast - Built with Rust, designed for performance and low resource usage.
- No Root Required - Unlike systemd, it doesn't take over PID 1.
Comparison vs Alternatives
| Feature | Systemg | systemd | Supervisor | Docker Compose |
|---|---|---|---|---|
| Lightweight | Yes | No (Heavy) | No (Python) | No (Containers) |
| No Dependencies | Yes | No (DBus, etc.) | No (Python) | No (Docker) |
| Simple Config | YAML | Complex Units | INI | YAML |
| Process Monitoring | Yes | Yes | Yes | Yes |
| PID 1 Required? | No | Yes | No | No |
| Handles Dependencies? | Yes | Yes | No | Yes |
Getting Started
Installation
Install the system binary:
|
Install systemg using cargo:
Or download the pre-built binary from the releases page.
Basic Commands
The sysg command-line interface provides several subcommands for managing processes.
Start
Start the process manager with the given configuration:
# Start with default configuration file (systemg.yaml)
# Start with a specific configuration file
# Start the long-lived supervisor (persists after you log out)
# Subsequent commands talk to the supervisor without re-spawning it
# Override logging verbosity for the current run (works with every subcommand; names or 0-5)
When the supervisor is running it remains active in the background, holding service
processes in the same process group so sysg stop, sysg restart, sysg status,
and sysg logs can coordinate them even after you disconnect from the shell that
started them.
Stop
Stop the process manager or a specific service:
# Stop the supervisor and every managed service
# Stop a specific service
Restart
Restart the process manager:
# Restart all services managed by the supervisor
# Restart with a different configuration
Status
Check the status of running services:
# Show status of all services
# Show status of a specific service
Logs
View logs for a specific service:
# View the last 50 lines of logs for all services
# View logs for a specific service
# View a custom number of log lines
Dependency handling
Declare service relationships with the depends_on field to coordinate startup order and health checks. Systemg will:
- start services in a topologically sorted order so each dependency is running or has exited successfully before its dependents launch;
- skip dependents whose prerequisites fail to start, surfacing a clear dependency error instead of allowing a partial boot;
- stop running dependents automatically when an upstream service crashes, preventing workloads from running against unhealthy backends.
For example:
services:
database:
command: "postgres -D /var/lib/postgres"
web:
command: "python app.py"
depends_on:
- database
If database fails to come up, web will remain stopped and log the dependency failure until the database is healthy again.
Testing
To run the test suite:
# Run all tests
# Run specific test
Build from Source
To build systemg from source:
# Clone the repository
# Build the project
# The binary will be available at target/release/sysg
Contributing
Contributions to systemg are welcome! Please see the CONTRIBUTING.md file for guidelines.