testsAndMisc/linux_configuration
Krzysztof kuhy Rudnicki 309f4c8d42 Repair live self-repair broken by the flatten and extractions
Five live mechanisms were silently pointing at paths that no longer exist.
None of them announced it; each degraded to a log line or a missing file.

- hosts-file-monitor.service is ACTIVE and watches /etc/hosts for tampering,
  but its embedded installer path was the pre-flatten scripts/ one. It logged
  "Hosts install script not found" 37 times: it detected tampering it could
  not repair.
- dns-blocklist-refresh.service (enabled, next run 00:01) named a deleted
  single_use/features/ path, as did media-organizer.service under utils/.
- setup_periodic_system.sh read all TEN of its templates from
  periodic_background/system-maintenance/, which has held nothing but
  untracked .pyc and .coverage residue since system-maintenance was
  extracted. Every install of a service, timer or script was reading a file
  that was not there.
- /etc/sudoers.d/hosts-install-no-passwd granted NOPASSWD on the old hosts
  installer path.

Running the fixed dns unit then caught a bug the static checks missed: under
systemd there is no SUDO_USER and `id -un` is root, so the new resolver
returned /root/hosts-blocker and the service died with "Feed generator not
found". extracted_repo_home() now handles the bare-root case by falling back
to the owner of the lib file itself. Verified across all four invocation
modes: as the user, via sudo, as root with SUDO_USER unset, and with an
explicit *_DIR override.

The service now reports "Feed refreshed and dnsmasq reloaded (189038 lines)".
/etc/hosts is untouched throughout -- still 176888 lines, still chattr +i,
still bind-mounted by its guard.

Live artifacts were patched via validated temp files, never in-place: the
sudoers drop-in was checked with `visudo -cf` before install, and every
original is backed up under /var/tmp/*.pre-{extract,fix}.

Stale live references: 8 -> 2. The 2 that remain name digital_wellbeing
paths and can only be fixed when that unit is extracted.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJrqKERAo5QUeEHWS5Asgp
2026-08-23 20:39:59 +02:00
..
.githooks Flatten i3-configuration and misc/testsAndMisc-bash 2026-08-23 19:02:18 +02:00
.github Prettier-normalize two docs the pre-push hook was already failing on 2026-08-23 19:42:18 +02:00
boot_recovery Cap extensionless scripts, and split the one that was hiding 2026-08-23 19:13:40 +02:00
C/atop_agg atop_agg: split atop_agg.c 478 -> 204 + state + emit 2026-08-17 10:49:46 +02:00
diagnostics Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
docs Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
dwm Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
features Extract the hosts blocker into its own repo 2026-08-23 20:30:18 +02:00
feedback-appimage Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
fixes Extract the hosts blocker into its own repo 2026-08-23 20:30:18 +02:00
fresh-install Extract the hosts blocker into its own repo 2026-08-23 20:30:18 +02:00
gaming Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
i3 Flatten i3-configuration and misc/testsAndMisc-bash 2026-08-23 19:02:18 +02:00
i3blocks Flatten i3-configuration and misc/testsAndMisc-bash 2026-08-23 19:02:18 +02:00
installers Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
lib Repair live self-repair broken by the flatten and extractions 2026-08-23 20:39:59 +02:00
meta Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
misc Flatten i3-configuration and misc/testsAndMisc-bash 2026-08-23 19:02:18 +02:00
periodic_background Repair live self-repair broken by the flatten and extractions 2026-08-23 20:39:59 +02:00
tests Point the diagnostics bats suite at the flattened path 2026-08-23 20:08:40 +02:00
utils Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
zsh Split calc-live.zsh: extract the qalc coprocess 2026-08-16 22:12:32 +02:00
.gitignore Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
install_core_system.sh Extract the hosts blocker into its own repo 2026-08-23 20:30:18 +02:00
test_results.log Add 'linux_configuration/' from commit '0762e3d07b90bac9256eb272de10bf9f42878094' 2026-02-06 21:43:26 +01:00