Built a narrative-driven daemon layer on top of my hobby Linux distro (systemd, bash, structured lore directories)

I’ve been building a small hobby distro in a VM (mostly for fun and to teach myself more about system design), and I ended up creating a “haunted OS” subsystem that’s actually… pretty functional? It’s basically a character-driven daemon layer that sits on top of a normal Linux base and reacts to system events, user actions, and resource changes.

Everything is implemented with standard Linux tooling — nothing magical, nothing outside POSIX. It’s just a creative layer on top of regular system architecture.

What it actually does under the hood:

  • A persistent systemd service (basement-ghost.service) that runs a daemon loop:
    • periodic randomized whispers selected from categorized files in /opt/basementos/lore/whispers.d/*
    • resource checks (disk fullness, memory availability)
    • patch-staleness checks via stat timestamps
    • network reachability checks (ping fallback)
    • occasional random “events” that get logged (nothing user-facing, just fun log entries)
  • Full category system for “omens”:
    • misc/
    • warnings/
    • blessings/
    • curses/
    • prophecies/ Each category is just plain text files with one whisper per line. The daemon and CLI can target categories on command.
  • A structured logging setup:
    • global system log at /var/log/basementos/ghost.log
    • per-user logs at ~/.basementos/ghost.log User whispers and omens get mirrored to the per-user log automatically.
  • User-facing commands:
  • Shell integration:
    • on every terminal launch, a background haunt terminal event is logged
    • everything is silent on the terminal side; no user interruption
    • option to enable rare “terminal whispers,” but it’s disabled by default so it doesn’t get annoying
  • Boot integration:
    • I preserved my clean /etc/issue banner
    • a one-shot systemd service rebuilds it at boot by appending a random whisper underneath This keeps the actual login banner readable and changes each boot without messing with MOTD or the shell.
  • Interactive tools:
    • basement-seance — a simple question → omen script
    • basement-oracle — a tiny TUI built with bash + tput that lets the user ask questions and select what kind of response they want (blessing/curse/warning/etc.)

Why I did it:
Honestly, mostly because it was fun. It started as a joke and turned into a really interesting exercise in building a coherent daemon ecosystem, tying userland scripts into systemd behavior, managing categorized config files, and designing small narrative tools that don’t interfere with the usability of the OS itself.

It also taught me more about good directory layout, per-user vs global logging, systemd service behavior, and clean shell scripting practices.

If anyone wants to see the code or the directory structure, I’m happy to share it. It’s all just bash + systemd + normal Linux stuff — nothing complicated, just a creative idea taken way too far.

Leave a Reply