Commit graph

73 commits

Author SHA1 Message Date
Virgil Dupras 2ae84fcc51 Revert tmpfs mount removal
To fix #406, I reverted the tmpfs mount we add at boot time. As we can
see in #455, it was a bad idea.

In addition to bringing back that mount, I've also added a
`tmpfs_mount_size` config that allows to change the size of the mount
from its default `2G`. It's also possible to disable the mount
altogether.

fixes #455
2018-02-02 16:02:17 -05:00
Virgil Dupras 582e3b368a halt: check that machine is running before attempting to clear tmpfiles
Otherwise, running `vagrant halt` on a stopped machine would make us
crash. Particularly annoying in multi-machines environments.

ref #406
2018-01-27 14:32:42 -05:00
Virgil Dupras 1c27047f4b Remove tmpfs mount on /tmp and bring back /tmp cleanup on halt
fixes #406 because the `tmpfs` mount isn't needed anymore.

Careful considerations had to be taken because #68 mentions host-side
data loss when cleaning up `/tmp`. We mitigate this by ensuring that all
mounts under `/tmp` are unmounted before we proceed with our `rm -rf`
operation.

More context about this issue can be found in #360.
2018-01-13 23:00:46 -05:00
Virgil Dupras aa777653f4 Use lxc-info instead of lxc-attach to retrieve container IP
`lxc-info -iH` to retrieve IP address was not available in early LXC
development but was there at LXC 1.0. Because we've bumped our minimum
LXC requirement to v1.0 recently, we can simplify the IP retrieval
process and also get rid of the `dnsmasq` fallback.
2018-01-13 15:53:28 -05:00
Cam Cope eba671c54d remove /tmp cleanup, fixes lvm rootfs 2015-08-17 17:43:24 -07:00
Fabio Rehm 447d0dfc42 Experimental support for private networking [GH-298] 2015-01-11 20:59:38 -02:00
Fabio Rehm bf3a9a5039 action: Some more tweaks around private networking + new pipework code [GH-298] 2015-01-08 03:57:49 -02:00
Fabio Rehm 28bdbe371d Merge remote-tracking branch 'origin/private-networks' into next 2015-01-08 02:28:45 -02:00
Fabio Rehm 67523019aa 👋 to support for Vagrant < 1.5 2015-01-07 23:48:10 -02:00
Fabio Rehm 186d453621 Prefix action to fetch containers IP with ssh so that vagrant does not lock around its execution
Closes GH-321
2014-10-15 01:02:52 -03:00
Ray Ruvinskiy dc55c914e4 Work around WaitForCommunicator lock race condition
The LXC provider issues the "fetch_ip" action to look up the IP address
of the container as part of its "ssh_info" action.
Vagrant::LXC::Action.action_fetch_ip checks the machine state using
Builtin::IsState, which calls Vagrant::Machine.state, which also updates
the state in the machine index and acquires a machine index entry lock to do that.
A race condition ensues in WaitForCommunicator.call, where ready_thr tries
to acquire the machine index lock while running ssh_info, and states_thr tries
to acquire the same lock doing its own state look up (env[:machine].state.id).
If they both try to acquire the lock at the same time, one will fail, and
an exception will be raised.

Work around this issue by checking for the desired machine state (:running) in
Vagrant::LXC::Provider.ssh_info, which can get the state from
Vagrant::LXC::Provider.state, which in turn does not write out the state into
the index file and does not acquire the index entry lock.
2014-09-29 16:47:29 -04:00
Franz Pletz ec4a52559a Add check for box updates to start action
This action apparently needs to be added to every provider. See
lib/vagrant/plugins/providers/virtualbox/action.rb from the Vagrant
source for reference how the virtualbox provider is doing it.
2014-09-05 20:52:03 +02:00
Fabio Rehm 5232f2c7b1 Begin work on supporting private networks 2014-06-09 00:48:52 -03:00
Kristof Willaert a4768c26ca Add fallback mechanism for platforms without attach support
Some platforms (most notably CentOS and RHEL) use a kernel without
'attach' support. This patch detects this absence and falls back
to the alternative ways of doing things like detection of IP address
and halting the container.
It does so by running the command "true" through lxc-attach.
2014-06-03 17:53:26 +02:00
Fabio Rehm 5df28390e2 Merge branch 'utsname-hostname' of github.com:fpletz/vagrant-lxc 2014-03-13 23:05:47 -03:00
Fabio Rehm dfd93d087c action: Keep old behavior of erroring on vagrant ssh -c instead of just showing a message 2014-03-13 23:02:18 -03:00
Fabio Rehm 7e79d59365 core: Fix vagrant ssh [GH-252] 2014-03-13 09:42:39 -03:00
Fabio Rehm 61002b9bb8 core: Remove actions that check for containers statuses 2014-03-13 00:57:37 -03:00
Fabio Rehm 803e446dc5 backports: Add IsState 2014-03-13 00:57:37 -03:00
Fabio Rehm 71b02ab511 We dont need to provide support for all versions on the 1.1.x series ;) 2014-03-13 00:57:37 -03:00
Fabio Rehm 23e82594e1 backports: Add Action::Message 2014-03-13 00:57:36 -03:00
Fabio Rehm f2c1f70cc7 backports: Alias 1.5 new Vagrant::UI::Interface methods 2014-03-13 00:57:36 -03:00
Fabio Rehm bb8514b518 core: "Tag" ShareFolders action as backport functionality 2014-03-13 00:57:36 -03:00
Fabio Rehm d5abb523de core: Implement support for built in synced folders and add required logic for NFS 2014-03-13 00:57:36 -03:00
Fabio Rehm a0acc571b2 core: Use HandleBox in case Vagrant 1.5 is in use 2014-03-13 00:57:36 -03:00
Fabio Rehm f5661280bc core: Kick off a vagrant-backports lib with method for verifying vagrant version 2014-03-13 00:57:36 -03:00
Fabio Rehm 6b5db24a6b Better than a note on the readme is a warning for users about unsupported private / public networks :)
Closes GH-154
2013-11-06 20:40:08 -02:00
Fabio Rehm bcfb7b3e00 Moar annotations 2013-09-28 01:46:26 -03:00
Fabio Rehm 2e5e5920d7 Shortcuts! 2013-09-28 01:05:10 -03:00
Fabio Rehm 2116737989 Dont worry about machine state when waiting for communicator [GH-142] [GH-146] 2013-09-27 12:27:25 -03:00
Fabio Rehm 6680858184 Improve logging and add some TODOs that have been around for a while 2013-09-21 01:32:15 -03:00
Fabio Rehm 791a93fe9e Make use of the new WaitForCommunicator action on boot 2013-09-12 01:10:11 -03:00
Fabio Rehm f13806626c Use vagrant 1.3+ ProvisionerCleanup builtin action on destroy 2013-09-11 22:10:18 -03:00
Fabio Rehm 0385a64d31 Replace ugly driver builder with a more intelligent approach
References #118
2013-07-29 12:08:24 -03:00
Fabio Rehm 97f6edeed8 Error out if LXC is not installed
This is enough to close #11
2013-07-28 02:55:00 -03:00
Fabio Rehm dee099ce96 Make use of vagrant's builtin action for handling forwarded port collisions
Closes #5
2013-07-28 02:39:11 -03:00
Fabio Rehm b190f45f45 Remove /tmp files after machine shutdown
Fixes #68
2013-05-08 20:13:19 -03:00
Fabio Rehm 10914d53b0 Add our own DestroyConfirm action 2013-04-18 03:11:36 -03:00
Fabio Rehm ecc127321f Get rid of dependency on VBox provider for displaying some messages to the user 2013-04-18 03:01:01 -03:00
Fabio Rehm 3a458df621 Add a general purpose ui "messager" / "logger" Action 2013-04-18 03:01:01 -03:00
Fabio Rehm e4dd0620ce Revert "Remove custom Disconnect action"
This reverts commit a8825b0b28.

I'm still having issues with SSH connections, even with 1.1.5
2013-04-10 01:37:07 -03:00
Fabio Rehm 116bde9655 Remove commented out actions that we wont implement 2013-04-10 00:09:45 -03:00
Fabio Rehm a8825b0b28 Remove custom Disconnect action 2013-04-08 21:12:49 -03:00
Fabio Rehm 1eb7b52da9 💣 custom machine state class 2013-04-08 20:12:05 -03:00
Fabio Rehm 670a43da00 Remove custom network action since we are not going to support it for a while 2013-04-05 22:10:49 -03:00
Fabio Rehm c433465432 Remove old comment 2013-04-05 22:10:48 -03:00
Fabio Rehm 164e57695e 💣 BaseAction 2013-04-05 22:10:48 -03:00
Fabio Rehm 23bb2e0733 Implement provider's package action 2013-03-30 19:19:38 -03:00
Fabio Rehm b54dcdc57b Remove commented out actions that we wont implement 2013-03-30 16:54:46 -03:00
Fabio Rehm 004ad783e3 Kill redir processes on machine halt 2013-03-26 22:14:31 -03:00