Merge pull request #2705 from tmatilai/upstart-emit-nfs

Emit upstart event `vagrant-mounted` also on NFS mounts
This commit is contained in:
Mitchell Hashimoto 2013-12-28 12:50:53 -08:00
commit 35d4737553
3 changed files with 7 additions and 20 deletions

View File

@ -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

View File

@ -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

View File

@ -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