testsAndMisc/linux_configuration/periodic_background/lib
Krzysztof kuhy Rudnicki b57d5f9064 Install live scripts by atomic rename
The periodic setup wrote /usr/local/bin scripts with sed > target,
truncating the file in place. bash reads scripts lazily, so the running
hosts-file-monitor could execute a half-new file.

New lib/atomic_install.sh renders into a temp file beside the target,
syntax-checks it, sets mode/owner and renames it over the target (new
inode). A bad template fails closed and leaves the live file untouched.
Applied to the maintenance script, hosts monitor, browser wrapper and
auto-update script; the hosts monitor service is restarted if running.

Test: test_services_atomic_install.sh (inode changes, old inode keeps
old bytes, syntax error and missing template leave target untouched).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWYWDKuhbBAoNETfoB9
2026-11-12 12:59:59 +01:00
..
tests Install live scripts by atomic rename 2026-11-12 12:59:59 +01:00
atomic_install.sh Install live scripts by atomic rename 2026-11-12 12:59:59 +01:00
periodic_browser.sh Install live scripts by atomic rename 2026-11-12 12:59:59 +01:00
services_apps.sh fix(services): report and remove a stale compulsive-block <app>.orig 2026-10-11 19:24:12 +02:00
services_browser.sh pacman wrapper: drop list-file checks and docs after list retirement 2026-10-17 18:46:17 +02:00
services_common.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
services_hosts_fix.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
services_hosts.sh Dissolve linux_configuration/scripts/ and single_use/ 2026-08-23 18:53:30 +02:00
services_report.sh DNS: dnsmasq bind-dynamic, no ordering cycle, stunnel Wants=; retire pc_startup check; repo paths under ~/src 2026-10-02 18:02:44 +02:00
services_units.sh DNS: dnsmasq bind-dynamic, no ordering cycle, stunnel Wants=; retire pc_startup check; repo paths under ~/src 2026-10-02 18:02:44 +02:00
services_wrappers.sh pacman wrapper: drop list-file checks and docs after list retirement 2026-10-17 18:46:17 +02:00