Skip to content

Commit

Permalink
qubes-dom0-update: prevent concurrent execution
Browse files Browse the repository at this point in the history
  • Loading branch information
alimirjamali committed Jul 1, 2024
1 parent f6b35ff commit d4933da
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dom0-updates/qubes-dom0-update
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ if [ "$ID" != 0 ] && [ -z "$GUI" ] && [ -z "$CHECK_ONLY" ] ; then
exit 1
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

if [ "$GUI" == "1" ] && [ ${#PKGS[@]} -ne 0 ]; then
echo "ERROR: GUI mode can be used only for updates" >&2
exit 1
Expand Down

0 comments on commit d4933da

Please sign in to comment.