Fix upstart detection and event emit

This commit is contained in:
Seth Vargo 2015-11-18 16:18:29 -08:00
parent 0ce636d1a3
commit 82f620ed13
3 changed files with 15 additions and 12 deletions

View File

@ -33,10 +33,11 @@ module VagrantPlugins
end
# Emit an upstart event if we can
if machine.communicate.test("test -x /sbin/initctl && test 'upstart' = $(basename $(sudo readlink /proc/1/exe))")
machine.communicate.sudo(
"/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{expanded_guest_path}")
end
machine.communicate.sudo <<-SCRIPT
if command -v /sbin/init &>/dev/null && /sbin/init --version | grep upstart &>/dev/null; then
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT='#{expanded_guest_path}'
fi
SCRIPT
end
end
end

View File

@ -86,10 +86,11 @@ module VagrantPlugins
end
# Emit an upstart event if we can
if machine.communicate.test("test -x /sbin/initctl && test 'upstart' = $(basename $(sudo readlink /proc/1/exe))")
machine.communicate.sudo(
"/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{expanded_guest_path}")
end
machine.communicate.sudo <<-SCRIPT
if command -v /sbin/init &>/dev/null && /sbin/init --version | grep upstart &>/dev/null; then
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT='#{expanded_guest_path}'
fi
SCRIPT
end
end
end

View File

@ -80,10 +80,11 @@ module VagrantPlugins
end
# Emit an upstart event if we can
if machine.communicate.test("test -x /sbin/initctl && test 'upstart' = $(basename $(sudo readlink /proc/1/exe))")
machine.communicate.sudo(
"/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{expanded_guest_path}")
end
machine.communicate.sudo <<-SCRIPT
if command -v /sbin/init &>/dev/null && /sbin/init --version | grep upstart &>/dev/null; then
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT='#{expanded_guest_path}'
fi
SCRIPT
end
def self.unmount_virtualbox_shared_folder(machine, guestpath, options)