diff --git a/0001-bin-vagrant-silence-warning-about-installer.patch b/0001-bin-vagrant-silence-warning-about-installer.patch index 6546b60..53be03d 100644 --- a/0001-bin-vagrant-silence-warning-about-installer.patch +++ b/0001-bin-vagrant-silence-warning-about-installer.patch @@ -1,7 +1,7 @@ From 6c2fcc93f7016ca2d816467327a33eb347cc1498 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Sat, 11 Oct 2014 16:54:58 -0300 -Subject: [PATCH 01/11] bin/vagrant: silence warning about installer +Subject: [PATCH 01/12] bin/vagrant: silence warning about installer Signed-off-by: Johannes Kastl --- diff --git a/0002-Use-a-private-temporary-dir.patch b/0002-Use-a-private-temporary-dir.patch index f068bd3..c3978f8 100644 --- a/0002-Use-a-private-temporary-dir.patch +++ b/0002-Use-a-private-temporary-dir.patch @@ -1,7 +1,7 @@ From 14c959018fc2e7d9fe6d5d396971a115efbdc71e Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Wed, 22 Oct 2014 09:40:14 -0200 -Subject: [PATCH 02/11] Use a private temporary dir +Subject: [PATCH 02/12] Use a private temporary dir Without this vagrant will clutter $TMPDIR with dozens of even hundreds of temporary files (~4 per vagrant invocation). diff --git a/0003-plugins-don-t-abuse-require_relative.patch.patch b/0003-plugins-don-t-abuse-require_relative.patch.patch index c75b014..bf0bb6b 100644 --- a/0003-plugins-don-t-abuse-require_relative.patch.patch +++ b/0003-plugins-don-t-abuse-require_relative.patch.patch @@ -1,7 +1,7 @@ From 5d0d5df6dcb54c5b423cbfa60c7e5eaccce380c9 Mon Sep 17 00:00:00 2001 From: Johannes Kastl Date: Wed, 17 May 2017 09:09:57 +0200 -Subject: [PATCH 03/11] plugins-don-t-abuse-require_relative.patch +Subject: [PATCH 03/12] plugins-don-t-abuse-require_relative.patch Signed-off-by: Johannes Kastl --- diff --git a/0004-fix-vbox-package-boo-1044087-added-by-robert.muntean.patch b/0004-fix-vbox-package-boo-1044087-added-by-robert.muntean.patch index 024cce8..0db8ec8 100644 --- a/0004-fix-vbox-package-boo-1044087-added-by-robert.muntean.patch +++ b/0004-fix-vbox-package-boo-1044087-added-by-robert.muntean.patch @@ -1,7 +1,7 @@ From 47cf5abe6ea46220b2d260e3e0fd07b42efa42ae Mon Sep 17 00:00:00 2001 From: Johannes Kastl Date: Fri, 16 Nov 2018 21:12:43 +0100 -Subject: [PATCH 04/11] fix vbox package boo#1044087, added by +Subject: [PATCH 04/12] fix vbox package boo#1044087, added by robert.munteanu@gmail.com on Sun Aug 13 19:07:06 UTC 2017 Signed-off-by: Johannes Kastl diff --git a/0005-do-not-depend-on-wdm.patch b/0005-do-not-depend-on-wdm.patch index 6ea6475..eca8d10 100644 --- a/0005-do-not-depend-on-wdm.patch +++ b/0005-do-not-depend-on-wdm.patch @@ -1,7 +1,7 @@ From c596dcd5e7bb3ab6bbdcbc9d21b640d828aa0925 Mon Sep 17 00:00:00 2001 From: Johannes Kastl Date: Mon, 4 Jun 2018 09:18:23 +0200 -Subject: [PATCH 05/11] do not depend on wdm +Subject: [PATCH 05/12] do not depend on wdm Signed-off-by: Johannes Kastl --- diff --git a/0006-do-not-abuse-relative-paths-in-docker-plugin-to-make.patch b/0006-do-not-abuse-relative-paths-in-docker-plugin-to-make.patch index 72160f8..654e937 100644 --- a/0006-do-not-abuse-relative-paths-in-docker-plugin-to-make.patch +++ b/0006-do-not-abuse-relative-paths-in-docker-plugin-to-make.patch @@ -1,7 +1,7 @@ From 9e4f4f017e58d7488de879037ee1564087c34008 Mon Sep 17 00:00:00 2001 From: Johannes Kastl Date: Fri, 16 Nov 2018 21:14:46 +0100 -Subject: [PATCH 06/11] do not abuse relative paths in docker plugin to make +Subject: [PATCH 06/12] do not abuse relative paths in docker plugin to make docker work, added by tmkn@tmkn.uk on Thu Oct 26 19:42:46 UTC 2017 Signed-off-by: Johannes Kastl diff --git a/0007-Don-t-abuse-relative-paths-in-plugins.patch b/0007-Don-t-abuse-relative-paths-in-plugins.patch index dedb4cf..ffff79f 100644 --- a/0007-Don-t-abuse-relative-paths-in-plugins.patch +++ b/0007-Don-t-abuse-relative-paths-in-plugins.patch @@ -1,7 +1,7 @@ From 79214e9936e35d2de125fe8d7c6fbbc424b4c054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Fri, 11 Jan 2019 12:32:28 +0100 -Subject: [PATCH 07/11] Don't abuse relative paths in plugins +Subject: [PATCH 07/12] Don't abuse relative paths in plugins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/0008-Skip-failing-tests.patch b/0008-Skip-failing-tests.patch index ee0e61b..91e94b3 100644 --- a/0008-Skip-failing-tests.patch +++ b/0008-Skip-failing-tests.patch @@ -1,7 +1,7 @@ From 39c3d177a8392eaed94be7a694f2f0c5df1e4ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Mon, 1 Apr 2019 17:28:31 +0200 -Subject: [PATCH 08/11] Skip failing tests +Subject: [PATCH 08/12] Skip failing tests --- test/unit/bin/vagrant_test.rb | 4 ++-- diff --git a/0009-Disable-Subprocess-unit-test.patch b/0009-Disable-Subprocess-unit-test.patch index 8c18f5f..17b5a37 100644 --- a/0009-Disable-Subprocess-unit-test.patch +++ b/0009-Disable-Subprocess-unit-test.patch @@ -1,7 +1,7 @@ From b9aba06ec4fb6c88f5109d1f79ed8820058c6077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Wed, 28 Aug 2019 13:39:58 +0200 -Subject: [PATCH 09/11] Disable Subprocess unit test +Subject: [PATCH 09/12] Disable Subprocess unit test This unit test is *very* flaky on OBS' workers and causes random build failures. These are probably caused by worker being under high load and then diff --git a/0010-Bump-listen-version-to-3.5.patch b/0010-Bump-listen-version-to-3.5.patch index d3b1e01..d9d9295 100644 --- a/0010-Bump-listen-version-to-3.5.patch +++ b/0010-Bump-listen-version-to-3.5.patch @@ -1,7 +1,7 @@ From 8fb45fd30524c9286a027c44e12351ddaefecade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Tue, 27 Apr 2021 10:27:11 +0200 -Subject: [PATCH 10/11] Bump listen version to ~> 3.5 +Subject: [PATCH 10/12] Bump listen version to ~> 3.5 (cherry picked from commit 016911965d5f995a5d0a168069de7ded7b380ecb) --- diff --git a/0011-Mock-the-PowerShell.executable-method-in-more-tests.patch b/0011-Mock-the-PowerShell.executable-method-in-more-tests.patch index cf9fc3d..7dd334f 100644 --- a/0011-Mock-the-PowerShell.executable-method-in-more-tests.patch +++ b/0011-Mock-the-PowerShell.executable-method-in-more-tests.patch @@ -1,7 +1,7 @@ From 2e76a77511d8c4f4ee1ea8cd2ee8ee5612316a07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Fri, 30 Apr 2021 09:37:20 +0200 -Subject: [PATCH 11/11] Mock the PowerShell.executable method in more tests +Subject: [PATCH 11/12] Mock the PowerShell.executable method in more tests On *nix systems we might not have powershell installed and then finding powershell.exe or pwsh.exe fails in some tests. If we instead mock diff --git a/0012-Use-systemctl-poweroff-in-the-background-instead-of-.patch b/0012-Use-systemctl-poweroff-in-the-background-instead-of-.patch new file mode 100644 index 0000000..940051d --- /dev/null +++ b/0012-Use-systemctl-poweroff-in-the-background-instead-of-.patch @@ -0,0 +1,62 @@ +From 60f35e059f92cb47a65a03066d34c2492160835e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= +Date: Thu, 1 Jul 2021 09:31:50 +0200 +Subject: [PATCH 12/12] Use systemctl poweroff in the background instead of + shutdown + +We have started seeing occasional shutdown failures on openSUSE Tumbleweed with +Virtualbox inside a qemu virtual machine, where `shutdown -h now` would return +nil. While the machine is successfully turned off, the command fails and vagrant +reports an error. +This commit changes the shutdown command to launch in the background which +also triggers a shutdown, but always succeeds. + +(cherry picked from commit 8ce38a639bfb21a8ac2e2c4d53812decf2c9ccaa) +--- + plugins/guests/suse/cap/halt.rb | 2 +- + test/unit/plugins/guests/suse/cap/halt_test.rb | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/plugins/guests/suse/cap/halt.rb b/plugins/guests/suse/cap/halt.rb +index 7a1375e39..3c996f092 100644 +--- a/plugins/guests/suse/cap/halt.rb ++++ b/plugins/guests/suse/cap/halt.rb +@@ -4,7 +4,7 @@ module VagrantPlugins + class Halt + def self.halt(machine) + begin +- machine.communicate.sudo("/sbin/shutdown -h now") ++ machine.communicate.sudo("/usr/bin/systemctl poweroff &") + rescue IOError, Vagrant::Errors::SSHDisconnected + # Do nothing, because it probably means the machine shut down + # and SSH connection was lost. +diff --git a/test/unit/plugins/guests/suse/cap/halt_test.rb b/test/unit/plugins/guests/suse/cap/halt_test.rb +index 7b998aad1..af8f575df 100644 +--- a/test/unit/plugins/guests/suse/cap/halt_test.rb ++++ b/test/unit/plugins/guests/suse/cap/halt_test.rb +@@ -22,19 +22,19 @@ describe "VagrantPlugins::GuestSUSE::Cap::Halt" do + let(:cap) { caps.get(:halt) } + + it "runs the shutdown command" do +- comm.expect_command("/sbin/shutdown -h now") ++ comm.expect_command("/usr/bin/systemctl poweroff &") + cap.halt(machine) + end + + it "does not raise an IOError" do +- comm.stub_command("shutdown -h now", raise: IOError) ++ comm.stub_command("/usr/bin/systemctl poweroff &", raise: IOError) + expect { + cap.halt(machine) + }.to_not raise_error + end + + it "ignores a Vagrant::Errors::SSHDisconnected" do +- comm.stub_command("shutdown -h now", raise: Vagrant::Errors::SSHDisconnected) ++ comm.stub_command("/usr/bin/systemctl poweroff &", raise: Vagrant::Errors::SSHDisconnected) + expect { + cap.halt(machine) + }.to_not raise_error +-- +2.31.1 + diff --git a/vagrant.changes b/vagrant.changes index 33aff70..5ed4c9c 100644 --- a/vagrant.changes +++ b/vagrant.changes @@ -1,3 +1,24 @@ +------------------------------------------------------------------- +Thu Jul 1 07:50:10 UTC 2021 - Dan Čermák + +- Add patch to fix occasional shutdown failures with virtualbox + + Rebase patches: + * 0001-bin-vagrant-silence-warning-about-installer.patch + * 0002-Use-a-private-temporary-dir.patch + * 0003-plugins-don-t-abuse-require_relative.patch.patch + * 0004-fix-vbox-package-boo-1044087-added-by-robert.muntean.patch + * 0005-do-not-depend-on-wdm.patch + * 0006-do-not-abuse-relative-paths-in-docker-plugin-to-make.patch + * 0007-Don-t-abuse-relative-paths-in-plugins.patch + * 0008-Skip-failing-tests.patch + * 0009-Disable-Subprocess-unit-test.patch + * 0010-Bump-listen-version-to-3.5.patch + * 0011-Mock-the-PowerShell.executable-method-in-more-tests.patch + + Added patches: + * 0012-Use-systemctl-poweroff-in-the-background-instead-of-.patch + ------------------------------------------------------------------- Fri Apr 30 06:08:48 UTC 2021 - Dan Čermák diff --git a/vagrant.spec b/vagrant.spec index be1b5d1..1658581 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -58,9 +58,13 @@ Patch7: 0007-Don-t-abuse-relative-paths-in-plugins.patch Patch8: 0008-Skip-failing-tests.patch Patch9: 0009-Disable-Subprocess-unit-test.patch # https://github.com/hashicorp/vagrant/pull/12329 +# merged -> drop on next upstream release Patch10: 0010-Bump-listen-version-to-3.5.patch # https://github.com/hashicorp/vagrant/pull/12339 +# merged -> drop on next upstream release Patch11: 0011-Mock-the-PowerShell.executable-method-in-more-tests.patch +# https://github.com/hashicorp/vagrant/pull/12439 +Patch12: 0012-Use-systemctl-poweroff-in-the-background-instead-of-.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build