Merge pull request #5622 from aneeshusa/fix-mounting-with-inactive-upstart

Check Upstart is running before emitting upstart events.
This commit is contained in:
Mitchell Hashimoto 2015-07-06 16:20:21 -06:00
commit 92e6062f8d
3 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ module VagrantPlugins
end
# Emit an upstart event if we can
if machine.communicate.test("test -x /sbin/initctl")
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

View File

@ -86,7 +86,7 @@ module VagrantPlugins
end
# Emit an upstart event if we can
if machine.communicate.test("test -x /sbin/initctl")
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

View File

@ -80,7 +80,7 @@ module VagrantPlugins
end
# Emit an upstart event if we can
if machine.communicate.test("test -x /sbin/initctl")
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