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.
17 lines
420 B
Ruby
17 lines
420 B
Ruby
module VagrantPlugins
|
|
module GuestSUSE
|
|
module Cap
|
|
class Halt
|
|
def self.halt(machine)
|
|
begin
|
|
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.
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|