Merge pull request #8051 from jklippel/vagrant-issue-7368

redirect any output to stderr by /sbin/init to /dev/null when checking for upstart capability
This commit is contained in:
Chris Roberts 2016-12-05 15:21:04 -08:00 committed by GitHub
commit 0587707044
3 changed files with 3 additions and 3 deletions

View File

@ -94,7 +94,7 @@ SCRIPT
# Emit an upstart event if we can # Emit an upstart event if we can
machine.communicate.sudo <<-SCRIPT 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}' /sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT='#{expanded_guest_path}'
fi fi
SCRIPT SCRIPT

View File

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

View File

@ -35,7 +35,7 @@ module VagrantPlugins
mount -o #{mount_opts} #{ip}:#{host_path} #{guest_path} mount -o #{mount_opts} #{ip}:#{host_path} #{guest_path}
result=$? result=$?
if test $result -eq 0; then 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} /sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{guest_path}
fi fi
else else