Skip to content

Commit

Permalink
Cirrus CI: configure apt-get to wait for locks
Browse files Browse the repository at this point in the history
I saw Cirrus CI / Vagrant BOX:rockylinux/8@5.0.0 failing during setting
up Vagrant, which may be due to other scripts provisioning the machine;

    Reading package lists...
    apt-get install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt
    E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 2496 (apt-get)
    E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

Configure dpkg to wait for locks to be released instead of failing. I used
60 second as timeout, which is relatively long, but given that the Vagrant
checks are known to take some time to run, is probably fine.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6a913ac)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Jul 14, 2023
1 parent fd0566c commit 60a6db9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .cirrus.yml
Expand Up @@ -26,8 +26,9 @@ task:
# v7.0.0 does not boot. v6.0.0 was not released.
BOX: rockylinux/8@5.0.0
install_libvirt_vagrant_script: |
apt-get update
apt-get install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt
# if another process is keeping a lock, wait for 60 seconds for it to release the lock.
apt-get -o DPkg::Lock::Timeout=60 update
apt-get -o DPkg::Lock::Timeout=60 install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt
systemctl enable --now libvirtd
vagrant_cache:
Expand Down Expand Up @@ -61,8 +62,9 @@ task:
memory: 16G

install_libvirt_vagrant_script: |
apt-get update
apt-get install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt
# if another process is keeping a lock, wait for 60 seconds for it to release the lock.
apt-get -o DPkg::Lock::Timeout=60 update
apt-get -o DPkg::Lock::Timeout=60 install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt
systemctl enable --now libvirtd
vagrant_cache:
Expand Down

0 comments on commit 60a6db9

Please sign in to comment.