diff --git a/plugins/guests/linux/cap/mount_nfs.rb b/plugins/guests/linux/cap/mount_nfs.rb index a3396cf54..aae63125c 100644 --- a/plugins/guests/linux/cap/mount_nfs.rb +++ b/plugins/guests/linux/cap/mount_nfs.rb @@ -31,6 +31,12 @@ module VagrantPlugins machine.communicate.sudo(mount_command, :error_class => Vagrant::Errors::LinuxNFSMountFailed) end + + # Emit an upstart event if we can + if machine.communicate.test("test -x /sbin/initctl") + machine.communicate.sudo( + "/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{expanded_guest_path}") + end end end end diff --git a/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb b/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb index 9459a9842..069614ded 100644 --- a/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb +++ b/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb @@ -73,7 +73,7 @@ module VagrantPlugins # Emit an upstart event if we can if machine.communicate.test("test -x /sbin/initctl") machine.communicate.sudo( - "/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{guestpath}") + "/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{expanded_guest_path}") end end end diff --git a/plugins/guests/ubuntu/cap/mount_nfs.rb b/plugins/guests/ubuntu/cap/mount_nfs.rb deleted file mode 100644 index d808e1cf0..000000000 --- a/plugins/guests/ubuntu/cap/mount_nfs.rb +++ /dev/null @@ -1,19 +0,0 @@ -require Vagrant.source_root.join("plugins/guests/linux/cap/mount_nfs") - -module VagrantPlugins - module GuestUbuntu - module Cap - class MountNFS < GuestLinux::Cap::MountNFS - def self.mount_nfs_folder(machine, ip, folders) - super - - # Emit an upstart events if upstart is available - folders.each do |name, opts| - real_guestpath = machine.guest.capability(:shell_expand_guest_path, opts[:guestpath]) - machine.communicate.sudo("[ -x /sbin/initctl ] && /sbin/initctl emit vagrant-mounted MOUNTPOINT=#{real_guestpath}") - end - end - end - end - end -end