Busser issues when /tmp is mounted with noexec
cheeseplus opened this issue · comments
Copied from: test-kitchen/test-kitchen#749
I´ve got the problem that busser installation fails due permission error:
Preparing files for transfer
-----> Installing Busser (busser)
Fetching: thor-0.19.0.gem (100%)
Successfully installed thor-0.19.0
Fetching: busser-0.7.1.gem (100%)
Successfully installed busser-0.7.1
2 gems installed
sh: 24: /tmp/verifier/gems/bin/busser: Permission denied
Installing Busser plugins: busser-serverspec
sudo: /tmp/verifier/bin/busser: command not found
>>>>>> Verify failed on instance <xyz-x86-64>.
>>>>>> Please see .kitchen/logs/default-xyz-x86-64.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: SSH exited (1) for command: [sh -c '
BUSSER_ROOT="/tmp/verifier"; export BUSSER_ROOT
GEM_HOME="/tmp/verifier/gems"; export GEM_HOME
GEM_PATH="/tmp/verifier/gems"; export GEM_PATH
GEM_CACHE="/tmp/verifier/gems/cache"; export GEM_CACHE
ruby="/opt/chef/embedded/bin/ruby"
gem="/opt/chef/embedded/bin/gem"
version="busser"
gem_install_args="busser --no-rdoc --no-ri"
busser="sudo -E /tmp/verifier/bin/busser"
plugins="busser-serverspec"
$gem list busser -i 2>&1 >/dev/null
if test $? -ne 0; then
echo "-----> Installing Busser ($version)"
$gem install $gem_install_args
else
echo "-----> Busser installation detected ($version)"
fi
if test ! -f "$BUSSER_ROOT/bin/busser"; then
gem_bindir=`$ruby -rrubygems -e "puts Gem.bindir"`
$gem_bindir/busser setup
fi
echo " Installing Busser plugins: $plugins"
$busser plugin install $plugins
']
>>>>>> ----------------------
sudo: /tmp/verifier/bin/busser: command not found
busser bin is installed in /tmp/verifier/gems/bin/busser
A link of the dirs doesn´t solve the problem.
What can I do?
I have the same problem on CentOS 6.6
The /etc/fstab mounts /tmp as non-executable.
tmpfs /tmp tmpfs size=512M,nodev,noexec,nosuid
Is there a way to specify an alternative location.
Specifying an alternate location worked for me. In the .kitchen.yml file:
verifier:
name: busser
root_path: /home/<%= ENV['SSH_USER'] %>/verifier
Where in my case I've specified the user (e.g. 'vagrant') in the environment.
Not so much a bug, as you're not supposed to run stuff from /tmp (nowadays 😉 ), hence the noxeec
mount flag.
Closing due to inactivity.
If this is still an issue please reopen or open another issue.
Thanks,
Test-Kitchen Maintainers