2012-05-23 22:57:43 +00:00
|
|
|
require "vagrant"
|
|
|
|
|
|
|
|
require Vagrant.source_root.join("plugins/guests/linux/guest")
|
|
|
|
|
2012-04-19 04:23:25 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module GuestOpenBSD
|
|
|
|
class Guest < VagrantPlugins::GuestLinux::Guest
|
2012-03-10 22:03:09 +00:00
|
|
|
def halt
|
|
|
|
vm.channel.sudo("shutdown -p -h now")
|
|
|
|
|
|
|
|
# Wait until the VM's state is actually powered off. If this doesn't
|
|
|
|
# occur within a reasonable amount of time then simply return which
|
|
|
|
# will cause Vagrant to force kill the machine.
|
|
|
|
count = 0
|
|
|
|
while vm.state != :poweroff
|
|
|
|
count += 1
|
|
|
|
|
|
|
|
return if count >= 30
|
|
|
|
sleep 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|