From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 9B6B06194C for ; Wed, 19 Aug 2020 07:28:23 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8B30218BF0 for ; Wed, 19 Aug 2020 07:27:53 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 5FD6C18BE5 for ; Wed, 19 Aug 2020 07:27:52 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 2879E446B3 for ; Wed, 19 Aug 2020 07:27:52 +0200 (CEST) From: Thomas Lamprecht To: pbs-devel@lists.proxmox.com Date: Wed, 19 Aug 2020 07:27:37 +0200 Message-Id: <20200819052737.3317-1-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.008 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] applied: [PATCH backup] d/postinst: fixup userid for older termproxy tasks X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2020 05:28:23 -0000 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 --- debian/postinst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/postinst b/debian/postinst index b416b7e8..9ab78798 100644 --- a/debian/postinst +++ b/debian/postinst @@ -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) -- 2.27.0