Skip to content

About

Tiny systemd service memory/crash watch dashboard for screen recordings

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Service Crash Watch

Русский · 简体中文

Service Crash Watch dashboard

Make a systemd crash or memory leak visible on screen in under a minute.

Service Crash Watch is a dependency-free Linux dashboard for reproducing and recording service failures. It polls the real systemd unit, cgroup-v2 memory files, /proc, ss, and the journal, then puts the useful counters and restart events in one video-friendly page.

It was built while debugging an opencode serve remote project-picker memory leak, but the watcher accepts any systemd service on a cgroup-v2 Linux host.

What it shows

The web UI refreshes every 500 ms and displays large, video-friendly counters:

  • cgroup memory.current and memory.peak
  • peak memory since dashboard startup
  • PID, PID uptime, and systemd restart count
  • RSS, PSS, anonymous memory, process swap, and VmSize
  • threads and file descriptors
  • TCP connection counts for two ports, including ESTAB and CLOSE_WAIT
  • recent journalctl -u <service> lines
  • detected PID changes and restart/crash events

The page flashes when PID or restart count changes, so crashes are visible in screen recordings.

Start in minutes

No Python packages need to be installed. From a checkout on a Linux host with Python 3, systemd, cgroup v2, and the command-line tools listed below, start the dashboard and run its API smoke test:

./start-dashboard.sh

The launcher is relative to its own checkout, so it works after cloning this repository elsewhere. It writes dashboard.pid, dashboard.log, and dashboard.err beside the scripts. To run the foreground server instead, use python3 opencode_watch_dashboard.py.

Open:

http://127.0.0.1:8765

Detailed installation and prerequisites, metrics and API, and operational notes are below the fold.

Configuration

Environment variables:

OC_SERVICE=opencode-remote.service  # systemd unit to watch
OC_DASH_HOST=127.0.0.1              # bind address
OC_DASH_PORT=8765                   # HTTP port

Example:

OC_SERVICE=opencode.service OC_DASH_PORT=8765 python3 opencode_watch_dashboard.py

Helper script

./start-dashboard.sh

This starts the dashboard with nohup, writes dashboard.pid, and prints a JSON API smoke test.

API

GET /api

Returns the same metrics used by the page.

Scope and limits

This is a local diagnostic dashboard, not a supervisor or alerting service. It reads the selected unit and recent journal; it does not restart services, retain history after process exit, or prove the root cause of a crash.

The watcher shells out to common Linux tools:

  • systemctl
  • journalctl
  • ss
  • ps
  • /proc/<pid>/status
  • /proc/<pid>/smaps_rollup
  • cgroup v2 files under /sys/fs/cgroup

No Python dependencies are required.

About

Tiny systemd service memory/crash watch dashboard for screen recordings

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages