openvibers/openvibe.host Commits
Data role: a running full backup is seen as running. A oneshot unit reads 'activating' while it runs, which is-active does not count, so the step now reads ActiveState and treats active or activating as a backup in progress (starting it again was harmless, since systemd joins the running job, but the log said otherwise).
Changes
@@@ -178,7 +178,9 @@ if [ "$HAVE_REPO" = 1 ]; thenrunuser -u postgres -- pgbackrest --stanza=openvibe checkcode=2fi-- if [ "$code" = 2 ] && ! systemctl is-active -q [email protected]; then++ # A oneshot unit reads "activating" while it runs; either state means a backup is in progress.++ state=$(systemctl show -p ActiveState --value [email protected] 2>/dev/null || true)++ if [ "$code" = 2 ] && [ "$state" != active ] && [ "$state" != activating ]; thenlog "no valid backup yet: starting a full backup ([email protected])"systemctl start --no-block [email protected]elif [ "$code" != 0 ] && [ "$code" != 2 ]; then
@@ -178,7 +178,9 @@ if [ "$HAVE_REPO" = 1 ]; then
@@ -178,7 +178,9 @@ if [ "$HAVE_REPO" = 1 ]; then
runuser -u postgres -- pgbackrest --stanza=openvibe check
runuser -u postgres -- pgbackrest --stanza=openvibe check
code=2
code=2
fi
fi
- if [ "$code" = 2 ] && ! systemctl is-active -q [email protected]; then
+ # A oneshot unit reads "activating" while it runs; either state means a backup is in progress.
+ state=$(systemctl show -p ActiveState --value [email protected] 2>/dev/null || true)
+ if [ "$code" = 2 ] && [ "$state" != active ] && [ "$state" != activating ]; then
log "no valid backup yet: starting a full backup ([email protected])"
log "no valid backup yet: starting a full backup ([email protected])"
systemctl start --no-block [email protected]
systemctl start --no-block [email protected]
elif [ "$code" != 0 ] && [ "$code" != 2 ]; then
elif [ "$code" != 0 ] && [ "$code" != 2 ]; then