Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files in /tmp Cannot be Executed in Centos 7 #155

Closed
coofercat opened this issue Aug 4, 2017 · 3 comments · Fixed by #230
Closed

Files in /tmp Cannot be Executed in Centos 7 #155

coofercat opened this issue Aug 4, 2017 · 3 comments · Fixed by #230

Comments

@coofercat
Copy link

By default, on Centos 7, files in /tmp cannot be executed (even if chmod 777) because the filesystem mount prevents it. The result is that all attempts to install RVM fail:

TASK [rvm_io.ruby : Install rvm] ******************************************************************************************************************************************************************************************************************
fatal: [myserver]: FAILED! => {"changed": false, "cmd": "/tmp/rvm-installer.sh stable --path /root/.rvm --auto-dotfiles --user-install", "failed": true, "msg": "[Errno 13] Permission denied", "rc": 13}

The solution is thankfully pretty simple - instead of running /tmp/something, just run /bin/bash /tmp/something. Therefore, in tasks/rvm.yml, the task to install RVM becomes:

- name: Install rvm
  command: >
    /bin/bash {{ rvm1_temp_download_path }}/rvm-installer.sh {{ rvm1_rvm_version }}
    --path {{ rvm1_install_path }} {{ rvm1_install_flags }}
  when: not rvm_binary.stat.exists

Incidentally, using shell instead of command doesn't work either. As far as I can see, this minor change will be compatible with other distributions and versions though, so hopefully low-risk.

@isikyus
Copy link

isikyus commented Jan 11, 2018

By default, on Centos 7, files in /tmp cannot be executed (even if chmod 777) because the filesystem mount prevents it. The result is that all attempts to install RVM fail:

This also affects Ubuntu 16.04.3.

@terry-mccarthy
Copy link

This seems to be still an issue .. workaround above works for me

@stevenhaddox
Copy link
Contributor

This is still an issue it seems. I just encountered the same error on CentOS 8. The above change seems to get it working perfectly.

stevenhaddox added a commit to stevenhaddox/rvm1-ansible that referenced this issue Nov 23, 2021
stevenhaddox added a commit to stevenhaddox/rvm1-ansible that referenced this issue Mar 1, 2022
stevenhaddox added a commit to stevenhaddox/rvm1-ansible that referenced this issue Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants