vagrant-lxc-ng/lib/vagrant-lxc/action/boot.rb

32 lines
854 B
Ruby
Raw Normal View History

module Vagrant
module LXC
module Action
2013-04-02 00:05:19 +00:00
class Boot
def initialize(app, env)
@app = app
end
def call(env)
@env = env
config = env[:machine].provider_config
2013-03-04 04:09:12 +00:00
2014-03-14 02:07:05 +00:00
utsname = env[:machine].config.vm.hostname || env[:machine].id
config.customize 'utsname', utsname
# Fix apparmor issues when starting Ubuntu 14.04 containers
# See https://github.com/fgrehm/vagrant-lxc/issues/278 for more information
if Dir.exists?('/sys/fs/pstore')
config.customize 'mount.entry', '/sys/fs/pstore sys/fs/pstore none bind,optional 0 0'
end
env[:ui].info I18n.t("vagrant_lxc.messages.starting")
env[:machine].provider.driver.start(config.customizations)
2013-03-04 04:09:12 +00:00
@app.call env
end
end
end
end
end