Table of Contents
Release Date: June 29, 2012
RightLink 5.8 requires users to SSH in as a non-privileged user and to use "sudo" if they want to run commands as root. For simple commands, "sudo foo" gets the job done. But sudo does not change any environment variables (such as $HOME) and does not execute root's bashrc. The result is that complex commands (things that refer to environment variables or read configuration files from the user's home directory) may not run as expected.
If you need to run complex commands through sudo, you should use the -i flag for sudo, which will simulate initial login, including setting $HOME to /root. This will cause complex commands to work better, preventing a tricky aspect of using the sudo command.
If a user logs into an instance as exampleuser and runs "sudo gem install foo" then the gem command will run using exampleuser's RubyGems configuration. Exampleuser does not have a .gemrc file in its home directory, so RubyGems reads the system defaults from /etc/gemrc. When RightLink freezes the RubyGems repository, it does not touch the system defaults; rather, it edits the .gemrc file in root's home directory. Therefore, running "sudo gem install foo" does not use the frozen RubyGems repository provided by the RightScale mirrors. However, "sudo -i gem install foo" does use the mirrors, because RubyGems correctly uses the .gemrc file in root's home directory.
© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.