diff --git a/lib/vagrant-lxc/action.rb b/lib/vagrant-lxc/action.rb index 49f0707..0b2a82a 100644 --- a/lib/vagrant-lxc/action.rb +++ b/lib/vagrant-lxc/action.rb @@ -13,7 +13,6 @@ require 'vagrant-lxc/action/handle_box_metadata' require 'vagrant-lxc/action/prepare_nfs_settings' require 'vagrant-lxc/action/prepare_nfs_valid_ids' require 'vagrant-lxc/action/private_networks' -require 'vagrant-lxc/action/remove_temporary_files' require 'vagrant-lxc/action/setup_package_files' require 'vagrant-lxc/action/warn_networks' @@ -126,7 +125,6 @@ module Vagrant end b2.use ClearForwardedPorts - b2.use RemoveTemporaryFiles b2.use GcPrivateNetworkBridges b2.use Builtin::Call, Builtin::GracefulHalt, :stopped, :running do |env2, b3| if !env2[:result] diff --git a/lib/vagrant-lxc/action/boot.rb b/lib/vagrant-lxc/action/boot.rb index 90b783f..08d331d 100644 --- a/lib/vagrant-lxc/action/boot.rb +++ b/lib/vagrant-lxc/action/boot.rb @@ -26,6 +26,9 @@ module Vagrant config.customize 'mount.entry', '/sys/fs/selinux sys/fs/selinux none bind,ro 0 0' 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[:machine].provider.driver.start(config.customizations) diff --git a/lib/vagrant-lxc/action/remove_temporary_files.rb b/lib/vagrant-lxc/action/remove_temporary_files.rb deleted file mode 100644 index 81a2f11..0000000 --- a/lib/vagrant-lxc/action/remove_temporary_files.rb +++ /dev/null @@ -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