Built a narrative-driven daemon layer on top of my hobby Linux distro (systemd, bash, structured lore directories)
Posted by tootiredtobecute@reddit | linux | View on Reddit | 3 comments
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
stattimestamps - network reachability checks (
pingfallback) - 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.logUser whispers and omens get mirrored to the per-user log automatically. - User-facing commands:
basement-ghost.shwhisper "<msg>"basement-ghost.shomen [category]basement-ghost.shhaunt <event>(shell events, patch events, “oops” events, etc.)basement-ghost.shstatus(tail of the daemon’s log)- Shell integration:
- on every terminal launch, a background
haunt terminalevent 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/issuebanner - 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 scriptbasement-oracle— a tiny TUI built with bash +tputthat 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.
siodhe@reddit
This sounds kinda cool, actually.
Never put suffixes on commands. It looks like you only did this to one program, but that ".sh" abomination needs to go. One list of reasons is at:
I would have liked to see that the service runs as the user, started at log in and killed at log out, but that just a issue of preferences.
Is this in a github repo or something? It'd be fun to check it out.
tootiredtobecute@reddit (OP)
Thank you! I’m honestly surprised how far this got — it started as a little experiment and turned into a whole subsystem.
Good call on the
.shsuffix. I only did that early on to keep track of what was mine while I was building things, but you’re right that it needs to go when I clean everything up.Running it as a user is on my list to play with too. Right now it’s global because it’s doing system-level checks, but I haven’t settled on what belongs in the “global ghost” vs “per-user ghost” layer yet.
I don’t have a GitHub repo up yet, but I’m planning to put one together. I’ll drop the link once it’s organized.
MagicalPancakes404@reddit
alive internet theory