6 releases (breaking)
Uses new Rust 2024
0.5.1 | Apr 6, 2025 |
---|---|
0.5.0 | Apr 6, 2025 |
0.4.0 | Mar 25, 2025 |
0.3.0 | Mar 5, 2025 |
0.1.0 | Feb 28, 2025 |
#293 in Configuration
393 downloads per month
405KB
1K
SLoC
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.
- Environment Variable Support - Load variables from
.env
files 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 systemg using cargo:
cargo install sysg
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)
sysg start
# Start with a specific configuration file
sysg start --config systemg.yaml
# Start as a daemon process
sysg start --config systemg.yaml --daemonize
Stop
Stop the process manager or a specific service:
# Stop all services
sysg stop
# Stop a specific service
sysg stop --service myapp
Restart
Restart the process manager:
# Restart with current configuration
sysg restart
# Restart with a different configuration
sysg restart --config new-config.yaml
Status
Check the status of running services:
# Show status of all services
sysg status
# Show status of a specific service
sysg status --service webserver
Logs
View logs for a specific service:
# View the last 50 lines of logs for all services
sysg logs
# View logs for a specific service
sysg logs api-service
# View a custom number of log lines
sysg logs database --lines 100
Testing
To run the test suite:
# Run all tests
cargo test
# Run specific test
cargo test test_service_lifecycle
Build from Source
To build systemg from source:
# Clone the repository
git clone https://github.com/ra0x3/systemg.git
cd systemg
# Build the project
cargo build --release
# The binary will be available at target/release/sysg
Contributing
Contributions to systemg are welcome! Please see the CONTRIBUTING.md file for guidelines.
Dependencies
~12–24MB
~362K SLoC