Graceful container shutdown
This commit is contained in:
parent
479f9a0cdc
commit
169f92bf55
1 changed files with 4 additions and 5 deletions
|
@ -97,12 +97,11 @@ module Vagrant
|
||||||
b.use CheckLXC
|
b.use CheckLXC
|
||||||
b.use Vagrant::Action::Builtin::Call, Created do |env, b2|
|
b.use Vagrant::Action::Builtin::Call, Created do |env, b2|
|
||||||
if env[:result]
|
if env[:result]
|
||||||
# TODO: If is paused, should resume and then halt
|
|
||||||
# TODO: If could not gracefully halt, force it
|
# TODO: If could not gracefully halt, force it
|
||||||
# TODO: b2.use Vagrant::Action::Builtin::GracefulHalt, :poweroff, :running
|
b2.use Vagrant::Action::Builtin::Call, Vagrant::Action::Builtin::GracefulHalt, :stopped, :running do |env2, b3|
|
||||||
unless env[:machine].state.off?
|
if !env2[:result] && env2[:machine].provider.state.running?
|
||||||
puts 'TODO: Halt container using Vagrant::Action::Builtin::GracefulHalt'
|
env2[:machine].provider.container.halt
|
||||||
env[:machine].provider.container.halt
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
b2.use VagrantPlugins::ProviderVirtualBox::Action::MessageNotCreated
|
b2.use VagrantPlugins::ProviderVirtualBox::Action::MessageNotCreated
|
||||||
|
|
Loading…
Add table
Reference in a new issue