Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Commit

Permalink
synced_folder: Emit vagrant-mounted upstart event when starting con…
Browse files Browse the repository at this point in the history
…tainers

Closes GH-302
  • Loading branch information
fgrehm committed Sep 23, 2014
1 parent 5e155ec commit 5fa6f0d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [1.0.0](https://github.com/fgrehm/vagrant-lxc/compare/v1.0.0.alpha.3...v1.0.0) (Sep 22, 2014)
## [1.0.0](https://github.com/fgrehm/vagrant-lxc/compare/v1.0.0.alpha.3...v1.0.0) (Sep 23, 2014)

BACKWARDS INCOMPATIBILITIES:

Expand All @@ -8,9 +8,12 @@ BACKWARDS INCOMPATIBILITIES:

IMPROVEMENTS:

- `vagrant-mounted` upstart event is now emited on containers that support it [[GH-302]]
- Add support for specifying the `--strip-parameters` used by the [default template](scripts/lxc-template)
when extracting rootfs tarballs [[GH-311]]

[GH-302]: https://github.com/fgrehm/vagrant-lxc/issues/302

BUG FIXES:

- Check for outdated base boxes when starting containers [[GH-314]]
Expand Down
21 changes: 21 additions & 0 deletions lib/vagrant-lxc/synced_folder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,27 @@ def prepare(machine, folders, _opts)
guest_path: data[:guestpath]))
end
end

def enable(machine, folders, _opts)
# Emit an upstart event if we can
return unless machine.communicate.test("test -x /sbin/initctl")

# short guestpaths first, so we don't step on ourselves
folders = folders.sort_by do |id, data|
if data[:guestpath]
data[:guestpath].length
else
# A long enough path to just do this at the end.
10000
end
end

folders.each do |id, data|
guest_path = data[:guestpath]
machine.communicate.sudo(
"/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{guest_path}")
end
end
end
end
end

0 comments on commit 5fa6f0d

Please sign in to comment.