From 2bcf4fa972fde686c2e3141c58e640640b44dd00 Mon Sep 17 00:00:00 2001 From: James Falcon Date: Tue, 14 Dec 2021 21:26:20 -0600 Subject: Include dpkg frontend lock in APT_LOCK_FILES (#1153) --- cloudinit/distros/debian.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cloudinit/distros/debian.py b/cloudinit/distros/debian.py index f3901470..b2af0866 100644 --- a/cloudinit/distros/debian.py +++ b/cloudinit/distros/debian.py @@ -43,10 +43,17 @@ NETWORK_FILE_HEADER = """\ NETWORK_CONF_FN = "/etc/network/interfaces.d/50-cloud-init" LOCALE_CONF_FN = "/etc/default/locale" +# The frontend lock needs to be acquired first followed by the order that +# apt uses. /var/lib/apt/lists is locked independently of that install chain, +# and only locked during update, so you can acquire it either order. +# Also update does not acquire the dpkg frontend lock. +# More context: +# https://github.com/canonical/cloud-init/pull/1034#issuecomment-986971376 APT_LOCK_FILES = [ + '/var/lib/dpkg/lock-frontend', '/var/lib/dpkg/lock', - '/var/lib/apt/lists/lock', '/var/cache/apt/archives/lock', + '/var/lib/apt/lists/lock', ] -- cgit v1.2.3