run command as login shell

831 views
Skip to first unread message

THUFIR HAWAT

unread,
Mar 16, 2012, 6:11:53 AM3/16/12
to rubyversi...@googlegroups.com
What does it mean to:

"Run command as a login shell

    Select this option to force the command that currently runs inside the terminal to run as a login shell. If the command is not a shell, the setting has no effect."
http://library.gnome.org/users/gnome-terminal/stable/gnome-terminal-prefs.html.en#gnome-terminal-prefs-title

I mucked up my environment by running RVM (Ruby Version Manager) with sudo and want to undo what was changed.

Now, I see that "The file ~/.bashrc is read by non-login interactive shells, and is sourced in ~/.profile, so that its content is also available in login shells."   http://askubuntu.com/questions/62288/why-do-i-need-to-run-source-command-for-making-bash-profile-alias-available

Presumably, .bashrc isn't being read because terminal is running as a login shell.

How do I undo whatever RVM did.  Looking at https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer it's not clear to me where .bashrc was messed up.


-Thufir

mpapis

unread,
Mar 16, 2012, 8:30:21 AM3/16/12
to rvm (Ruby Version Manager)
Just bellow on the gnome-terminal site you have a link to explanation
for login shell -> https://rvm.beginrescueend.com/support/faq/#shell_login

as for undoing the multi user installation please follow this
instruction:
http://stackoverflow.com/questions/9056008/installed-ruby-1-9-3-with-rvm-but-command-line-doesnt-show-ruby-v/9056395#9056395
It's very similar to what you need to do (possibly the apt-get might
fail)

On Mar 16, 11:11 am, THUFIR HAWAT <hawat.thu...@gmail.com> wrote:
> What does it mean to:
>
> "Run command as a login shell
>
>     Select this option to force the command that currently runs inside the
> terminal to run as a login shell. If the command is not a shell, the
> setting has no effect."http://library.gnome.org/users/gnome-terminal/stable/gnome-terminal-p...
>
> I mucked up my environment by running RVM (Ruby Version Manager) with sudo
> and want to undo what was changed.
>
> Now, I see that "The file ~/.bashrc is read by non-login interactive
> shells, and is sourced in ~/.profile, so that its content is also available
> in login shells."  http://askubuntu.com/questions/62288/why-do-i-need-to-run-source-comm...
>
> Presumably, .bashrc isn't being read because terminal is running as a login
> shell.
>
> How do I undo whatever RVM did.  Looking athttps://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer

Atastor

unread,
Mar 20, 2012, 4:44:36 AM3/20/12
to rubyversi...@googlegroups.com
One additional remark: I had trouble getting the proxy-related environment settings of my production server working in my capistrano deployment setting, e.g. in my case I had put

export http_proxy="<proxy-url>"
export https_proxy=$http_proxy
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$https_proxy

at the end of .bashrc. This resulted in "bundle install ..." failing miserably when called from cap deploy:setup, and working like a charm when logged into the server.

The failure was related to the servers debian system, which apparently puts something like

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

at the very beginning of the .bashrc. Thus, when deploying, the proxy settings never were executed. The fix of course was to put the proxy settings right before this return statement.

Regards
Michael
Reply all
Reply to author
Forward
0 new messages