diff --git a/plugins/guests/linux/cap/mount_smb_shared_folder.rb b/plugins/guests/linux/cap/mount_smb_shared_folder.rb index 867a2ddc4..bbec27148 100644 --- a/plugins/guests/linux/cap/mount_smb_shared_folder.rb +++ b/plugins/guests/linux/cap/mount_smb_shared_folder.rb @@ -94,7 +94,7 @@ SCRIPT # Emit an upstart event if we can machine.communicate.sudo <<-SCRIPT -if command -v /sbin/init && /sbin/init --version | grep upstart; then +if command -v /sbin/init && /sbin/init 2>/dev/null --version | grep upstart; then /sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT='#{expanded_guest_path}' fi SCRIPT diff --git a/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb b/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb index eb9640bf5..4f285cff8 100644 --- a/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb +++ b/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb @@ -89,7 +89,7 @@ module VagrantPlugins # Emit an upstart event if we can machine.communicate.sudo <<-EOH.gsub(/^ {12}/, "") - if command -v /sbin/init && /sbin/init --version | grep upstart; then + if command -v /sbin/init && /sbin/init 2>/dev/null --version | grep upstart; then /sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{guest_path} fi EOH diff --git a/plugins/guests/linux/cap/nfs.rb b/plugins/guests/linux/cap/nfs.rb index 28e25c461..8dadae1f3 100644 --- a/plugins/guests/linux/cap/nfs.rb +++ b/plugins/guests/linux/cap/nfs.rb @@ -35,7 +35,7 @@ module VagrantPlugins mount -o #{mount_opts} #{ip}:#{host_path} #{guest_path} result=$? if test $result -eq 0; then - if test -x /sbin/initctl && command -v /sbin/init && /sbin/init --version | grep upstart; then + if test -x /sbin/initctl && command -v /sbin/init && /sbin/init 2>/dev/null --version | grep upstart; then /sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{guest_path} fi else