From 538e1616286edacb8a7458d46b98e64921738edc Mon Sep 17 00:00:00 2001 From: Ali Mirjamali Date: Sun, 30 Jun 2024 21:51:35 +0330 Subject: [PATCH] qubes-dom0-update: prevent concurrent execution fixes: https://github.com/QubesOS/qubes-issues/issues/6345 --- dom0-updates/qubes-dom0-update | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dom0-updates/qubes-dom0-update b/dom0-updates/qubes-dom0-update index e23455e..3eb5d4e 100755 --- a/dom0-updates/qubes-dom0-update +++ b/dom0-updates/qubes-dom0-update @@ -41,6 +41,13 @@ if [ "$1" = "--help" ]; then exit fi +exec 9>"/var/lock/qubes-dom0-update.lock" +flock -n 9 +if [[ ${?} -ne 0 ]]; then + echo "Another instance of qubes-dom0-update is already running!" + exit 1 +fi + PKGS=() YUM_OPTS=() UPDATEVM_OPTS=()