rss/README.md

73 lines
1.7 KiB
Markdown

# rss — RuSt Supervisor
Lightweight, per-user process supervisor. No daemon, no root, no virtualization.
## Philosophy
- **KISS** — one binary, one job. Each service gets its own supervisor process.
- **UNIX way** — PID files for state, no IPC, no sockets.
- **User-space** — everything under `~/.config/rss/` and `~/.local/share/rss/`.
- **No root** — runs entirely as your user.
## Usage
```
rss start <name> Start a service
rss stop <name> Stop a service
rss restart <name> Restart a service
rss status [name] Show service status
rss logs <name> [-n N] [-f] View logs (last N, follow)
rss enable <name> [--now] Enable auto-start
rss disable <name> Disable auto-start
rss list List all services
rss daemon Start all enabled services
```
## Configuration
Place `config.toml` in `~/.config/rss/config.toml`.
```toml
[service.NAME]
workdir = "/path/to/project"
command = "your command here"
stop_command = "optional stop command"
timeout_start = 15
timeout_stop = 10
restart = "on-failure" # no, always, on-failure
restart_delay = 3
restart_max = 5 # 0 = unlimited
oneshot = false
stop_signal = "TERM"
env = { KEY = "value" }
```
Placeholders in `command` / `stop_command`: `{name}`, `{workdir}`, `{pid}`, `{log_file}`, plus any env var.
See `config.example.toml` for a full example.
## systemd (user mode)
```sh
mkdir -p ~/.config/systemd/user
cp contrib/rss.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable rss
systemctl --user start rss
```
Requires `linger` for headless users:
```sh
sudo loginctl enable-linger $USER
```
## Install
```sh
cargo install --path .
```
## License
MIT