forumone / web-starter

Starting place for developing Drupal, Wordpress and other web applications
http://forumone.github.io/web-starter/
22 stars 11 forks source link

Address problems with CentOS software collections and vagrant's sudo_command option #206

Closed gustavderdrache closed 8 years ago

gustavderdrache commented 8 years ago

RedHat's scl scripts provide a wrapper script for the sudo command that does not respect arguments, leading to situations like the following:

$ sudo -E
/var/tmp/sclQzI0km: line 8: -E: command not found

Until the wrapper script is able to parse sudo flags, the solution is prevent Vagrant's SSH communicator plugin from passing flags to sudo when running commands. This PR addresses that by overriding config.ssh.sudo_command with sudo %c instead of the default, which is sudo -E -k %c (and the cause of the "line 8: -E" errors).

arh1 commented 8 years ago

Note that this change requires version 1.7.3 or newer of Vagrant.

johnbburg commented 8 years ago

Another common and cryptic error message from this issue is:

/sbin/ip -o -0 addr | grep -v LOOPBACK | awk '{print $2}' | sed 's/://'

Just adding it to improve this issue's search-ability.

mshade commented 8 years ago

@johnbburg full error:

==> default: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/sbin/ip -o -0 addr | grep -v LOOPBACK | awk '{print $2}' | sed 's/://'

Stdout from the command:

Stderr from the command:

/var/tmp/sclmsonaB: line 8: -E: command not found

Seems it's just the same old sudo error from enabling software collections globally.