diff --git a/debian/postinst b/debian/postinst index 3a53e686..489cf6ac 100644 --- a/debian/postinst +++ b/debian/postinst @@ -48,6 +48,16 @@ case "$1" in true fi + if dpkg --compare-versions "$2" 'lt' '2.3.1~'; 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'" + chown backup:backup /etc/proxmox-backup/.datastore.lck \ + || printf "Failed to fix datastore.lck user, please retry manually with:\n\n\t%s\n\n" \ + "chown backup:backup /etc/proxmox-backup/.datastore.lck" + fi + fi + if dpkg --compare-versions "$2" 'lt' '2.1.3~' && test -e /etc/proxmox-backup/sync.cfg; then prev_job=""