Check Upstart is running before emitting upstart events.

Fixes issue #5377.
Check that Upstart is not just installed but currently actively running
before attempting to emit an event after mounting shared folders.
Only requires the binary be named upstart, not that it lives in /sbin.
This commit is contained in:
Aneesh Agrawal 2015-04-22 09:18:34 -04:00
parent bdb945cd1b
commit 49ff17b9b9
3 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ module VagrantPlugins
end end
# Emit an upstart event if we can # 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( machine.communicate.sudo(
"/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{expanded_guest_path}") "/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{expanded_guest_path}")
end end

View File

@ -82,7 +82,7 @@ module VagrantPlugins
end end
# Emit an upstart event if we can # 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( machine.communicate.sudo(
"/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{expanded_guest_path}") "/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{expanded_guest_path}")
end end

View File

@ -80,7 +80,7 @@ module VagrantPlugins
end end
# Emit an upstart event if we can # 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( machine.communicate.sudo(
"/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{expanded_guest_path}") "/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{expanded_guest_path}")
end end