fix: atomic writes, crash safety, deadlock prevention across 10 files

watchdog.uc:
- H-4: ai_heal_uci_config atomic write (tmp → rename)
- H-5: backup validation via uci valid before restart
- H-6: proxy restart cooldown (max 3 per 10 min)
- H-7: restart lock file prevents parallel restarts
- H-13: ai_heal_wan_interface reads 'network' not 'tachyon' config
- M-3: nslookup -port=53 → plain nslookup (BusyBox compat)

generator.uc: atomic_write_json_file for main config output
hosts.uc: atomic cache write (tmp + mv), TOCTOU double stat fix
telegram.uc: atomic config restore, persistent /etc/.tachyon/ paths
migration.uc: UCI commit before cache removal
updates.uc: background reload inside locked section (deadlock prevention)
lifecycle.uc: uci commit return check, watchdog/telegram failure logging
package.uc: postinst_restore returns actual start result
build.sh/install.sh: Wave 1 backup/restore fixes
This commit is contained in:
Dushnilin
2026-08-03 19:43:10 +03:00
parent 0a428083af
commit c7febcb0dc
10 changed files with 205 additions and 69 deletions
+2 -1
View File
@@ -1550,10 +1550,11 @@ function migrate_runtime(source) {
return true;
apply_operations(cursor, ctx.operations);
let committed = commit_cursor(cursor);
for (let path in ctx.removed_caches)
remove_cache_path(path);
return commit_cursor(cursor);
return committed;
}
function commit_runtime() {