Preview mode that survives a reboot, and a fallback log that survives one too

This commit is contained in:
Gmer4Lfe
2026-08-22 13:52:34 -04:00
parent ac17be2cd9
commit 15d802ae3d
5 changed files with 77 additions and 5 deletions
+6 -4
View File
@@ -84,9 +84,11 @@ $scripts = rtrim(SCRIPTS_DIR, '/');
$cmds = [
'stop' => 'bash ' . escapeshellarg("$scripts/Fallback/fallback.sh") . ' --stop 2>&1',
'stop_test' => 'bash ' . escapeshellarg("$scripts/Fallback/fallback_test.sh") . ' --stop 2>&1',
// setsid so it outlives this request; own log so the page can show what the preview said.
// setsid so it outlives this request. No redirect: fallback.sh writes its own persistent
// log when stdout is not a terminal, so an ad-hoc preview and the array-start daemon leave
// their record in the same file rather than one going to tmpfs and vanishing on reboot.
'start_dry' => 'setsid bash ' . escapeshellarg("$scripts/Fallback/fallback.sh")
. ' --dry-run --log > /tmp/varaverk/fallback_dryrun.log 2>&1 < /dev/null & echo started',
. ' --dry-run --log > /dev/null 2>&1 < /dev/null & echo started',
'clear_lock' => 'rm -f /tmp/unraid_locks/fallback.lock /tmp/unraid_locks/fallback_test.lock && echo cleared',
];
@@ -119,8 +121,8 @@ if ($remoteDir === '') $remoteDir = '/boot/config/plugins/varaverk';
$remoteCmds = [
'stop' => "bash '$remoteDir/Fallback/fallback.sh' --stop 2>&1",
'stop_test' => "bash '$remoteDir/Fallback/fallback_test.sh' --stop 2>&1",
'start_dry' => "mkdir -p /tmp/varaverk; setsid bash '$remoteDir/Fallback/fallback.sh'"
. " --dry-run --log > /tmp/varaverk/fallback_dryrun.log 2>&1 < /dev/null & echo started",
'start_dry' => "setsid bash '$remoteDir/Fallback/fallback.sh'"
. " --dry-run --log > /dev/null 2>&1 < /dev/null & echo started",
'clear_lock' => 'rm -f /tmp/unraid_locks/fallback.lock /tmp/unraid_locks/fallback_test.lock && echo cleared',
];