2013-03-03 05:24:05 +00:00
|
|
|
module Vagrant
|
|
|
|
module LXC
|
|
|
|
module Action
|
2013-04-02 00:05:19 +00:00
|
|
|
class Boot
|
|
|
|
def initialize(app, env)
|
|
|
|
@app = app
|
|
|
|
end
|
|
|
|
|
2013-03-03 05:24:05 +00:00
|
|
|
def call(env)
|
2013-03-11 03:12:01 +00:00
|
|
|
@env = env
|
|
|
|
|
2013-03-03 07:37:07 +00:00
|
|
|
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
|
2013-06-06 03:03:37 +00:00
|
|
|
|
2014-05-13 02:27:13 +00:00
|
|
|
# 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
|
|
|
|
|
2015-03-24 21:42:11 +00:00
|
|
|
# Make selinux read-only, see
|
|
|
|
# https://github.com/fgrehm/vagrant-lxc/issues/301
|
|
|
|
if Dir.exists?('/sys/fs/selinux')
|
|
|
|
config.customize 'mount.entry', '/sys/fs/selinux sys/fs/selinux none bind,ro 0 0'
|
|
|
|
end
|
|
|
|
|
2013-04-18 06:19:43 +00:00
|
|
|
env[:ui].info I18n.t("vagrant_lxc.messages.starting")
|
2013-04-10 02:33:30 +00:00
|
|
|
env[:machine].provider.driver.start(config.customizations)
|
2013-03-04 04:09:12 +00:00
|
|
|
|
2013-03-03 05:24:05 +00:00
|
|
|
@app.call env
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|