Merge pull request #362 from ccope/halt-lvm-fix
remove /tmp cleanup command, fixes lvm rootfs
This commit is contained in:
commit
0c353598f8
3 changed files with 3 additions and 25 deletions
|
@ -13,7 +13,6 @@ require 'vagrant-lxc/action/handle_box_metadata'
|
||||||
require 'vagrant-lxc/action/prepare_nfs_settings'
|
require 'vagrant-lxc/action/prepare_nfs_settings'
|
||||||
require 'vagrant-lxc/action/prepare_nfs_valid_ids'
|
require 'vagrant-lxc/action/prepare_nfs_valid_ids'
|
||||||
require 'vagrant-lxc/action/private_networks'
|
require 'vagrant-lxc/action/private_networks'
|
||||||
require 'vagrant-lxc/action/remove_temporary_files'
|
|
||||||
require 'vagrant-lxc/action/setup_package_files'
|
require 'vagrant-lxc/action/setup_package_files'
|
||||||
require 'vagrant-lxc/action/warn_networks'
|
require 'vagrant-lxc/action/warn_networks'
|
||||||
|
|
||||||
|
@ -126,7 +125,6 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
b2.use ClearForwardedPorts
|
b2.use ClearForwardedPorts
|
||||||
b2.use RemoveTemporaryFiles
|
|
||||||
b2.use GcPrivateNetworkBridges
|
b2.use GcPrivateNetworkBridges
|
||||||
b2.use Builtin::Call, Builtin::GracefulHalt, :stopped, :running do |env2, b3|
|
b2.use Builtin::Call, Builtin::GracefulHalt, :stopped, :running do |env2, b3|
|
||||||
if !env2[:result]
|
if !env2[:result]
|
||||||
|
|
|
@ -26,6 +26,9 @@ module Vagrant
|
||||||
config.customize 'mount.entry', '/sys/fs/selinux sys/fs/selinux none bind,ro 0 0'
|
config.customize 'mount.entry', '/sys/fs/selinux sys/fs/selinux none bind,ro 0 0'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Make /tmp a tmpfs to prevent init scripts from nuking synced folders mounted in here
|
||||||
|
config.customize 'mount.entry', 'tmpfs tmp tmpfs nodev,nosuid,size=2G 0 0'
|
||||||
|
|
||||||
env[:ui].info I18n.t("vagrant_lxc.messages.starting")
|
env[:ui].info I18n.t("vagrant_lxc.messages.starting")
|
||||||
env[:machine].provider.driver.start(config.customizations)
|
env[:machine].provider.driver.start(config.customizations)
|
||||||
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
module Vagrant
|
|
||||||
module LXC
|
|
||||||
module Action
|
|
||||||
class RemoveTemporaryFiles
|
|
||||||
def initialize(app, env)
|
|
||||||
@app = app
|
|
||||||
@logger = Log4r::Logger.new("vagrant::lxc::action::remove_tmp_files")
|
|
||||||
end
|
|
||||||
|
|
||||||
def call(env)
|
|
||||||
# Continue execution, we need the container to be stopped
|
|
||||||
@app.call env
|
|
||||||
|
|
||||||
if env[:machine].state.id == :stopped
|
|
||||||
@logger.debug 'Removing temporary files'
|
|
||||||
tmp_path = env[:machine].provider.driver.rootfs_path.join('tmp')
|
|
||||||
env[:machine].provider.sudo_wrapper.run('rm', '-rf', "#{tmp_path}/*")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Reference in a new issue