Sunday 15 August 2010

ruby - RVM $PATH variables to homeless user -


I have a scaffolding server that is running Ubuntu 12.04 and I do some things on git to automate the deployment of some repositories We are building the receiving script that we live on that server.

I have created a homeless user 'GIT' (for security reasons) to settle the GHT's SSH connection.

I have to run drive compilation (Compass has been set up as ruby ​​gem) When someone puts something on the repo, But RVM was used to install and manage Ruby. And I used the multi-user approach to do all the RVM installation process. When I run Ruby-V with 'git' user, I get the right output, I mean, RVM multi-user installation is almost fine.

The problem is that when I try to run an executable gem

I saw that in my normal user's .bash_profile (it was added by RVM): < / P>

  [[-s "/ usr / local / rvm / scripts / rvm"]] & amp; & Amp; Source "/ usr / local / rvm / scripts / rvm" # As a function * Load the RVM in the shell session *   

Add the Gem Bin directory to $ PATH.

  [General] $ $ ebb $ PATH /usr/local/rvm/gems/ruby-1.9.2-p320/bin:/usr/local/rvm/gems/ruby-1.9 2-p320 @ global / bin: /usr/local/rvm/rubies/ruby-1.9.2-p320/bin: / usr / local / rvm / bin: / usr / local / sbin: / usr / local / bin: / Usr / Sbin: / usr / bin: / sbin: / bin: / usr / games: /usr/local/rvm/gems/ruby-1.9.2-p320/bin/: / usr / local / rvm / bin < / Code>  

As the 'git' user is homeless does not have .bash_profile, so I added that code to /etc/profile.d/

on a script But that did not work because every time I use git as / usr / local / rvm / scripts / rvm Try filing do, it is git's out bash session and return to my normal user session. This is something like this:

  [normal] $ sudo -u git bash [git] $ exec / usr / local / rvm / scripts / rvm [general] $   

No erros has been printed ...

Why is the rvm script exiting the bash session?

How can I set rvm $ path to homeless user?

Three problems:

  1. / Bin / sh should not be used, it is not supported by RVM, instead of using / bin / bash (but you have already received it
  2. As the current shell explained by @casar = & gt; changes with your order to run, there is no return there
  3. There are docs in the Init.d =>;

    You enter a shell initialization file Switch to should not try to source Arvim for the user, because it is not used by Initdrak script, instead of using the wrapper, this is the perfect way to work.

No comments:

Post a Comment