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

Emit "vagrant-mounted" upstart event #302

Closed
pesho opened this issue Jun 30, 2014 · 6 comments
Closed

Emit "vagrant-mounted" upstart event #302

pesho opened this issue Jun 30, 2014 · 6 comments

Comments

@pesho
Copy link

pesho commented Jun 30, 2014

The built-in Vagrant VirtualBox provider emits this event after the synced folder is mounted. It is necessary, as services may depend on the folder being present.

@fgrehm
Copy link
Owner

fgrehm commented Jul 4, 2014

The thing is that different from the VBox provider, when the container starts it already have the synced folders mounted. Dunno what's the best approach to do that here....

Any thoughts of what we can do here to support it?

@pesho
Copy link
Author

pesho commented Jul 4, 2014

It shouldn't matter that the folder is already mounted on start actually, as long as the event is emitted at some point afterwards (this way upstart scripts could be compatible with both vagrant-lxc and the default virtualbox provider).

For the record, this is the relevant code for the virtualbox provider: https://github.com/mitchellh/vagrant/blob/5530f32922a912c4c6a8b13e5d480a80ae5f051e/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb#L79

@fgrehm fgrehm added this to the v1.0.0 milestone Jul 22, 2014
@fgrehm
Copy link
Owner

fgrehm commented Jul 22, 2014

No worries, tagged as an enhancement

@CameronNemo
Copy link

Wait is this event emitted inside or outside the container? If inside, then something like this is possible:

start on container

task

exec initctl emit -n vagrant-mounted

That does not give you the MOUNTPOINT variable, but is that necessary?

It also emits the event on more than just lxc, if you want just lxc, use this:

start on container CONTAINER=lxc or container CONTAINER=libvirt-lxc

@pesho
Copy link
Author

pesho commented Sep 14, 2014

@CameronNemo With the official VirtualBox provisioner, it's emitted from outside. However, with vagrant-lxc it probably makes more sense to emit it from inside the container (the box itself could probably be updated to emit it, as you suggest).

Regarding the MOUNTPOINT variable, I myself don't use it, but someone else might.

@fgrehm
Copy link
Owner

fgrehm commented Sep 22, 2014

I believe we'd follow the approach from the VBox provider and emit the event from outside, it shouldn't be hard.

@fgrehm fgrehm closed this as completed in 5fa6f0d Sep 23, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants