Allow SQLite to create its rollback snapshot journal
This commit is contained in:
1 parent
4e35a3a557
commit
73ccb1bb75
1 file changed
+9
-5
@@ -66,7 +66,7 @@ finish() {
|
|||||||
if ((services_stopped)); then
|
if ((services_stopped)); then
|
||||||
if systemctl stop "${gateway_units[@]}"; then
|
if systemctl stop "${gateway_units[@]}"; then
|
||||||
if ((snapshot_ready)); then
|
if ((snapshot_ready)); then
|
||||||
runuser -u seiugw -- sqlite3 -bail "$database" ".restore '$work/gateway.db'" || restored=0
|
runuser -u seiugw -- sqlite3 -bail "$database" ".restore '$work/database/gateway.db'" || restored=0
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
restored=0
|
restored=0
|
||||||
@@ -94,7 +94,11 @@ finish() {
|
|||||||
status failed "Fehler bei $step. Die installierte Version läuft weiter." || true
|
status failed "Fehler bei $step. Die installierte Version läuft weiter." || true
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
rm -f -- "$work/result" "$work/gateway.db" "$work/gateway.db-wal" "$work/gateway.db-shm" "$work/status.json"
|
if [[ -d $work/database ]]; then
|
||||||
|
rm -f -- "$work/database/"{gateway.db,gateway.db-wal,gateway.db-shm,gateway.db-journal}
|
||||||
|
rmdir -- "$work/database"
|
||||||
|
fi
|
||||||
|
rm -f -- "$work/result" "$work/status.json"
|
||||||
rmdir -- "$work"
|
rmdir -- "$work"
|
||||||
exit "$code"
|
exit "$code"
|
||||||
}
|
}
|
||||||
@@ -140,9 +144,9 @@ systemctl stop "${gateway_units[@]}"
|
|||||||
[[ -f $database ]]
|
[[ -f $database ]]
|
||||||
chgrp seiugw "$work"
|
chgrp seiugw "$work"
|
||||||
chmod 0710 "$work"
|
chmod 0710 "$work"
|
||||||
install -o seiugw -g seiugw -m 0600 /dev/null "$work/gateway.db"
|
install -d -o seiugw -g seiugw -m 0700 "$work/database"
|
||||||
runuser -u seiugw -- sqlite3 -bail "$database" ".backup '$work/gateway.db'"
|
runuser -u seiugw -- sqlite3 -bail "$database" ".backup '$work/database/gateway.db'"
|
||||||
[[ $(sqlite3 -bail "$work/gateway.db" 'PRAGMA quick_check') == ok ]]
|
[[ $(runuser -u seiugw -- sqlite3 -readonly -bail "$work/database/gateway.db" 'PRAGMA quick_check') == ok ]]
|
||||||
snapshot_ready=1
|
snapshot_ready=1
|
||||||
|
|
||||||
step="Aktivierung"
|
step="Aktivierung"
|
||||||
|
|||||||
Reference in new issue
Block a user