]> git.proxmox.com Git - proxmox-backup.git/commitdiff
d/postinst: fixup userid for older termproxy tasks
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 18 Aug 2020 16:41:30 +0000 (18:41 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 19 Aug 2020 05:26:58 +0000 (07:26 +0200)
At the time when we can fix this up the new (and possibly an old)
server daemon process is running, so use the flock CLI tool from
util-linux to ensure we do the same locking as the server and thus we
avoid a race condition.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
debian/postinst

index b416b7e89d3e42034678f2c3af8109116d5de86a..9ab787989ff63d493affcbdcb556c95d9583206b 100644 (file)
@@ -14,6 +14,13 @@ case "$1" in
                _dh_action=start
        fi
        deb-systemd-invoke $_dh_action proxmox-backup.service proxmox-backup-proxy.service >/dev/null || true
+
+       if test -n "$2"; then
+               if dpkg --compare-versions "$2" 'le' '0.8.10-1'; then
+                       echo "Fixing up termproxy user id in task log..."
+                       flock -w 30 /var/log/proxmox-backup/tasks/active.lock sed -i 's/:termproxy::root: /:termproxy::root@pam: /' /var/log/proxmox-backup/tasks/active
+               fi
+       fi
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)