| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Sermo is a portable, safety-first service supervisor for Linux hosts. It sits above systemd and OpenRC, validates a service before it ever acts on it, understands the service's real processes, and applies guarded remediation rules — it never restarts blindly and never kills the wrong process.
Where an init system answers "is the unit active?", Sermo answers the harder operational questions: is the service actually healthy, is it safe to touch right now, and if it isn't healthy, what is the safe thing to do? It monitors, diagnoses, remediates under strict invariants, keeps availability (SLA) history, watches host-level resources, sends notifications, and serves a live web dashboard — all from a single daemon.
A plain "restart on failure" supervisor is dangerous on a real host: it restarts during a backup, kills a process that happens to share a binary name, or acts on a service whose config is broken and makes the outage worse. Sermo is built around the opposite principle — prove it is safe, then act:
Monitoring & health
Safe remediation
Availability & history
Operate
Web dashboard (optional)
A single daemon (sermod) loads the configuration and the packaged catalog, resolves them into a service tree, and builds a fleet: one Worker per service and one Watch per host resource or app. A scheduler runs them in a loop. The CLI and the web UI talk to the daemon over HTTP and signals. Every action on a service — manual or automatic — goes through operation.Engine, which coordinates locks, preflight, guards and the init backend, so the CLI and the daemon can never diverge in how they act.
clients ── sermoctl (CLI) ─┐ ┌── operation.Engine ── systemd / OpenRC
browser (Web UI) ┤ ├── named locks (oplock + scanner)
│ sermod (daemon) │
signals ── SIGHUP ────┼── Monitor ─ Scheduler ─ Fleet ┤── state store (SLA · events · metrics)
SIGTERM ────┘ │ (Worker per service │── notifiers (email/slack/teams/webhook)
│ Watch per resource)│
config + packaged catalog ────┘ └── web.Server (dashboard + /api)
See docs/architecture.md for the faithful, code-anchored diagrams (operation pipeline, lock states, monitoring cycle).
These cannot be turned off in YAML — validation rejects any security: toggle that tries. In full in docs/safety.md:
make build # produces bin/sermoctl and bin/sermod
make test # run the test suiteRequires Go 1.26.7+. Runtime dependencies: systemctl or rc-service on the host.
sermod runs as root. It manages services owned by different users and accesses privileged areas (service control, signalling other users' processes, cross-user /proc inspection including per-process IO, raw ICMP sockets), so the packaged units run it as root; it warns at startup if it is not. The config is therefore trusted, root-owned input — command checks and hooks run as root (never via a shell), so keep /etc/sermo root-only and put secrets in the environment (${env:NAME}). See safety. Read-only sermoctl commands (status, config, etc.) do not need root.
make install honors the standard GNU directory variables and DESTDIR staging, and installs the binaries, the full catalog (keeping the services/apps/libs/patterns layout), a sample sermo.yml, the default notification template, the tmpfiles.d config, and both the systemd unit and the OpenRC init script (with their binary/config paths rewritten to match):
sudo make install PREFIX=/usr # /usr/bin, /usr/sbin or merged-/usr /usr/bin, /etc/sermo, ...
make install DESTDIR=/tmp/stage PREFIX=/usr # stage for packagingKey variables (override on the command line): DESTDIR, PREFIX/prefix, bindir, sbindir, datadir, sysconfdir, TMPFILESDIR, SYSTEMD_UNITDIR, OPENRC_INITDIR. Granular targets are available too: install-bin, install-catalog, install-config, install-templates, install-tmpfiles, install-systemd, install-openrc (and uninstall). An existing sermo.yml is never overwritten. make install does not create /var/lib/sermo; the installed tmpfiles.d config owns that directory creation.
On merged-/usr hosts where /usr/sbin is a symlink to /usr/bin, the default sbindir collapses to $(bindir) so DESTDIR packages do not materialize a real usr/sbin directory and replace the host symlink when extracted. Pass an explicit sbindir=... only when the target really has a distinct sbin directory.
Do not deploy a DESTDIR tree by extracting a tar archive directly into / with preserved directory metadata. A staged tree contains directory entries such as ./, etc/ and usr/; plain tar -xpf can apply those modes to existing system directories. Use the package manager, copy the installed files directly, or extract ad-hoc test archives with:
sudo tar --no-overwrite-dir -C / -xpf sermo-stage.tar# Inspect a unit (no config needed)
sermoctl backend
sermoctl status nginx
sermoctl is-active nginx
# List catalog inventory, not configured runtime targets
sermoctl services # packaged catalog service profiles (nginx, mariadb, ...)
sermoctl services all # include profiles not installed on this host
sermoctl services --notify ops-email # email a services inventory report
sermoctl apps # tools/runtimes (only installed)
sermoctl apps all # include not-installed
sermoctl libs # shared libraries (restart triggers)
# Validate configuration
sermoctl config validate
# Operate a configured service through the safe engine
sermoctl restart apache-main
# Pause / resume monitoring of a service (e.g. for maintenance)
sermoctl unmonitor apache-main # daemon stops checking it
sermoctl monitor apache-main # resume
sermoctl daemon reload # ask sermod to re-read its config
# Fence a maintenance window with a named runtime lock
sermoctl lock apache-main --reason backup --ttl 1h -- /usr/local/bin/backup.sh
# Availability (SLA) per service over rolling windows (hour..year)
sermoctl sla # all services
sermoctl sla apache-main # one service
sermoctl sla --series apache-main --since 168h # per-minute series (graph data)
# Run the daemon
sermod run --config /etc/sermo/sermo.ymlPackaged definitions live under catalog/, sample configs under examples/, packaging units under packaging/. The on-host file layout is in configuration → layout. Daemon flags (--verbose) are in CLI → sermod daemon flags.
| Back | FazBrowse Home | New Git URL |