rss/README.md
Niko Marmeladkov b069c527bd
daemon: centralized architecture with Unix socket IPC
- single daemon process manages all services in memory
- CLI communicates via Unix socket, does not read config
- config hot-reload: daemon polls config.toml, reacts immediately
- rename-safe: removing a service from config kills it, adding starts if enabled
- logs remain file-based for direct reading by rss logs
- removed per-service PID files, supervisor module simplified
2026-07-03 11:49:46 +03:00

81 lines
1.9 KiB
Markdown

# rss — RuSt Supervisor
Lightweight, per-user process supervisor. No root, no virtualization.
## Architecture
- **Single daemon** (`rss daemon`) manages all services in-process
- **CLI** (`rss start`, `rss stop`, etc.) talks to the daemon via Unix socket
- **No PID files** for services — state lives in daemon memory
- **Config hot-reload** — rename/add/remove services live, daemon detects changes
- **Logs** written to `~/.local/share/rss/logs/<name>.log` — readable by CLI directly
## Usage
First start the daemon (via systemd or terminal):
```
rss daemon
```
Then manage services:
```
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
```
## 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, unless-stopped, 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.
Edit `config.toml` any time — the daemon picks up changes live.
## 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