When a Viral Lemmy Thread Made Me Rethink My Kid's Screen Time — And My Codebase

I was scrolling Lemmy late one night, coffee cooling beside a half‑finished PR, when a thread exploded: parents swapping horror stories about kids who could bypass every parental‑control app in minutes. The comments read like a post‑mortem of a distributed system — race conditions, hidden APIs, privileged daemons. My stomach tightened. My own seven‑year‑old had just figured out how to kill the screen‑time daemon by sending SIGKILL from a terminal emulator he’d installed on his tablet.

The next morning I opened the repo for the daemon I’d written three years ago — a tiny Go service that polled systemd timers and wrote JSON logs to /var/log/screentime. It was a single binary, no tests, no metrics, no graceful shutdown. I added a pprof endpoint, wrapped the timer loop in a context.WithCancel, and shipped a Prometheus exporter so I could see “session‑seconds” in Grafana. The first dashboard showed a 40 % drop in unauthorized extensions after I enforced a read‑only filesystem mount for the app’s data directory.

I also rewrote the UI in React‑Native, but kept the backend pure Go — no Electron bloat, no hidden Node processes. The build pipeline now runs golangci-lint, go test -race, and docker build --target=prod on every push. CI fails if the binary exceeds 12 MB or if any unsafe pointer slips in.

Tonight the tablet stays dark after 8 pm, and the logs show a clean SIGTERM followed by a graceful flush. My kid asks for “five more minutes” and I can answer with a dashboard instead of a guess. If you’re wrestling with the same chaos, start small — instrument, isolate, iterate. The rest follows.