From b10bc2e8c278f34593c4dd23ddf5ede533619261 Mon Sep 17 00:00:00 2001 From: jklippel Date: Tue, 29 Nov 2016 08:10:25 +0100 Subject: [PATCH] Vagrant-Issue: 7368: redirect any output to stderr by /sbin/init to /dev/null when checking for upstart capability --- plugins/guests/linux/cap/mount_smb_shared_folder.rb | 2 +- plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb | 2 +- plugins/guests/linux/cap/nfs.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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