testsAndMisc/linux_configuration/scripts
Krzysztof kuhy Rudnicki 3ebb56ccbb
Some checks are pending
Pre-commit checks / pre-commit (push) Waiting to run
feat(shutdown): night lockdown instead of power-off, so servers stay up
The digital-wellbeing curfew powered the PC off at 21:00, which also took
down every service this machine hosts (Gitea, the Caddy TLS edge, SyncYomi,
the personal site, Open WebUI, Joplin, dufs, ollama, dnsmasq, wg-quick,
sshd). Keep the curfew's lockout, drop the power-off: the machine now stays
on with the GUI torn down, the TTY login surface masked, the console blanked
and the RGB killed, and restores itself at 05:00.

The fortress still owns the schedule (immutable config, ratchet, monitor,
watchdog); only its terminal action is swapped for night-lockdown-enter.sh.
The reversal deliberately lives outside the fortress so a bug in the lock
path can never take the recovery path down with it.

Verified in production overnight: lightdm down 21:00:04 -> 05:00:00 while
all 7 containers stayed "Up 14 hours" and kept serving; ticks idempotent all
night; 05:00 unlock fired.

Notable fixes found along the way:
- Wake alarm regression: it only ever fired on resume-from-hibernate, so an
  always-on machine silently killed it. The unlock now re-fires
  morning-routine.service on alarm days (the Mon/Fri/Sat/Sun gate lived in
  the removed rtcwake branch, not in the alarm).
- Morning boundary -le -> -lt, so 05:00 no longer races the unlock.
- Mask getty@ only; autovt@ is an alias of it and masking it errors.
- Persist LOCKED before the session-killing teardown, else a kill mid-lock
  leaves state=UNLOCKED and the unlock no-ops, stranding the machine.
- Blank the console without DPMS: FB_BLANK_POWERDOWN drops the DisplayPort
  link and the GPU never re-trains it (DP-0 needed a physical re-plug).
- RGB: openrgb-git 0.9.2148's CLI returns before detection finishes, so every
  call silently no-op'd while exiting 0. Stable openrgb 1.0rc3 fixes it. Use
  static+black, not "off" (the ZOTAC has no Off mode; the ASRock ignores it).
- Validate the generated config with bash -n: its heredoc must stay unquoted,
  so a stray backtick executes and corrupts the file.

Thu-Sun 22->21 aligns the source with the canonical schedule screen_locker's
sick-day feature ratcheted in on 2026-07-03; the ratchet only permits
same/stricter, so the script was otherwise un-re-runnable.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dpu8SqqBVm97tCuTGE3nCs
2026-07-17 09:09:54 +02:00
..
gaming style: apply prettier formatting to evidence JSON and dwm/gaming READMEs 2026-06-14 07:22:04 +02:00
lib Harden runtime script deployment and enforce installer safety 2026-05-08 17:44:22 +02:00
meta Add 'linux_configuration/' from commit '0762e3d07b90bac9256eb272de10bf9f42878094' 2026-02-06 21:43:26 +01:00
periodic_background feat(shutdown): night lockdown instead of power-off, so servers stay up 2026-07-17 09:09:54 +02:00
single_use Add personal website deploy + move Gitea to a subdomain 2026-07-13 19:10:48 +02:00