[pbs-devel] [PATCH proxmox-backup 2/2] d/postinst: check if datastore lockfile actually exists

Fiona Ebner f.ebner at proxmox.com
Thu Dec 15 09:13:25 CET 2022


On an installation that never had any datastores, dkpg would fail to
configure the package.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 debian/postinst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/postinst b/debian/postinst
index 489cf6ac..0485ca34 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -48,7 +48,7 @@ case "$1" in
 			true
 		fi
 
-		if dpkg --compare-versions "$2" 'lt' '2.3.1~'; then
+		if dpkg --compare-versions "$2" 'lt' '2.3.1~' && test -e /etc/proxmox-backup/.datastore.lck; then
 			lock_user="$(stat --format '%U' /etc/proxmox-backup/.datastore.lck)"
 			if [ "${lock_user}" != "backup" ]; then
 				echo "updating /etc/proxmox-backup/.datastore.lck from wrong user '${lock_user}' to 'backup'"
-- 
2.30.2






More information about the pbs-devel mailing list