While installing Discourse using Digital Ocean and 12.04 Ubuntu (64) and following the steps outlined at https://github.com/discourse/discourse/blob/master/docs/INSTALL-ubuntu.md, I found that switching back to the ‘discourse’ user after installing missing components that rvm told me about would just hang.
So I finally checked out my .profile and here is what I found:
# ~/.profile: executed by the command interpreter for login shells. # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login # exists. # see /usr/share/doc/bash/examples/startup-files for examples. # the files are located in the bash-doc package. # the default umask is set in /etc/profile; for setting the umask # for ssh logins, install and configure the libpam-umask package. #umask 022 # if running bash if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi fi # set PATH so it includes user's private bin if it exists if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi [[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
That second-to-last line of actual code seems to be calling this very file again, causing an infinite loop. I commented it out and was able to log in as ‘discourse’ successfully.
I have no idea if this is somehow just a problem for me, or if others might have a similar issue. Just wanted to let someone know.