d/postinst: check if datastore lockfile actually exists

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

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fiona Ebner 2022-12-15 09:13:25 +01:00 committed by Wolfgang Bumiller
parent f082fa7351
commit 6c03b0ae4c

2
debian/postinst vendored
View File

@ -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'"