Merge pull request #1717 from toretore/master
guests/ubuntu: Emit Ubuntu Upstart 'vagrant-mounted' (regression)
This commit is contained in:
commit
8bc01c7cb1
|
@ -0,0 +1,18 @@
|
||||||
|
require_relative '../../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
|
|
@ -0,0 +1,14 @@
|
||||||
|
require_relative '../../linux/cap/mount_virtualbox_shared_folder'
|
||||||
|
|
||||||
|
module VagrantPlugins
|
||||||
|
module GuestUbuntu
|
||||||
|
module Cap
|
||||||
|
class MountVirtualBoxSharedFolder < GuestLinux::Cap::MountVirtualBoxSharedFolder
|
||||||
|
def self.mount_virtualbox_shared_folder(machine, name, guestpath, options)
|
||||||
|
super
|
||||||
|
machine.communicate.sudo("[ -x /sbin/initctl ] && /sbin/initctl emit vagrant-mounted MOUNTPOINT=#{guestpath}")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -15,6 +15,17 @@ module VagrantPlugins
|
||||||
require_relative "cap/change_host_name"
|
require_relative "cap/change_host_name"
|
||||||
Cap::ChangeHostName
|
Cap::ChangeHostName
|
||||||
end
|
end
|
||||||
|
|
||||||
|
guest_capability("ubuntu", "mount_virtualbox_shared_folder") do
|
||||||
|
require_relative "cap/mount_virtualbox_shared_folder"
|
||||||
|
Cap::MountVirtualBoxSharedFolder
|
||||||
|
end
|
||||||
|
|
||||||
|
#I don't know if this works or not
|
||||||
|
#guest_capability("linux", "mount_nfs_folder") do
|
||||||
|
# require_relative "cap/mount_nfs"
|
||||||
|
# Cap::MountNFS
|
||||||
|
#end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue