-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
/etc/profile.d/chruby.sh graphical login issue with Ubuntu 12.04 #56
Comments
I'm curious what |
Also, did you set zsh as your shell via |
Thanks for the rapid response! I'll take a look when I get to my laptop to see where /bin/sh points to. I used chsh to set my shell to zsh. |
/bin/sh points to /bin/dash Also, here are the contents of /etc/profile on my system (which to my memory is the default version of it):
|
I suspect Ubuntu is spawning |
After much discussion, this appears to be the best way to cause
|
* This will ensure that dash will not error on loading chruby.sh.
With this change I can login without issue, however chruby doesn't get loaded. |
Could you post your |
When I set my user up to use bash the new /etc/profile.d/chruby.sh file works! :) Ubuntu puts its global zsh config in /etc/zsh, all the default files contain only comments except for /etc/zsh/zshrc and /etc/zsh/zshenv. I'll add the contents of both those files, although /etc/zsh/zshenv is quite boring.
|
Double check if any of the global zsh config files load |
It looks like that isn't the case, I'll investigate in more detail as soon as I can. |
I've taken another hard look, and they aren't being loaded :/ |
To make this work on Ubuntu with zsh by default I guess the setup script would have to add something to /etc/zsh/zprofile or maybe even /etc/zsh/zshenv. Maybe its best to add a note to the README to explain this exception for Ubuntu 12.04? Or would you rather update the setup script to cater for Ubuntu's exception? In any case I'd be willing to help out... |
Did the updated |
When I log in graphically then the profile.d script doesn't get loaded, even if I use bash. When I log in on a console (by switching with CTRL+ALT+F1) it works only for bash, because Ubuntu (at least) 12.04 doesn't load the /etc/profile.d/*.sh files for zsh. If I modify my /etc/zsh/zprofile to execute the script it does work, but again only when I login using a console:
|
Once I've logged in graphically, and I execute ". /etc/profile.d/chruby.sh" in a terminal window then chruby gets loaded for that session as you'd expect. |
I'm doing some digging into this... I've modified /etc/profile.d/chruby.sh to output the env to a file, and it shows there is no $BASH_VERSION or $ZSH_VERSION (explaining why a graphical login doesn't load chruby). $SHELL is set to /usr/bin/zsh |
I think I am doing something wrong with outputting the env, because when I login through the console I also do not get $BASH_VERSION or $ZSH_VERSION in the output. I output the env using "env > /home/mkremer/loginenv" |
I got all the shell variables by using the set command instead of env, when logging in graphically there really is no $BASH_VERSION or $ZSH_VERSION. |
I think you should report this to Ubuntu. They are apparently have customized how the shell is loaded for Unity/terminal. I wish zsh had an equivalent to |
I think you're right, when I next have the time I'll figure out how to report this to Ubuntu. Looking at the default files present in /etc/profile.d it wouldn't do any harm if Ubuntu would simply load those up for zsh like Fedora does... To make chruby work for me in both cases I've added the below snippet to my .zshrc:
Perhaps its worthwhile updating the README to indicate the state of this issue, so other Ubuntu users know how to make this work for them? I'll be sure to update this issue when I report this to Ubuntu. Thanks for all your help so far on this issue, I really appreciate it a lot! |
I've posted a question on Launchpad: https://answers.launchpad.net/unity-greeter/+question/219654 Hopefully this will lead to a solution :) |
How about |
The bigger problem is that Ubuntu 12.04 doesn't handle the login process with the user's login shell, it seems to be processing it with dash instead which seems to fail on chruby.sh |
Unfortunately my launchpad question got no answer and then got cleaned up by the Launchpad janitor :( I've opened a question on askubuntu in the hopes of getting an answer there: http://askubuntu.com/questions/251618/how-does-the-shell-environment-load-when-logging-in-graphically |
Robert Ancell re-opened my question on Launchpad and posted an answer on https://answers.launchpad.net/lightdm/+question/219654 that clarifies some of this, I have asked him for more information. |
Hello. I see that the original issue discussed in this thread has not been fixed. I use Ubuntu 12.04, my I have incorporated postmodern's suggestion from earlier in this thread into my fork of chruby. Hopefully it can be pulled or cherry-picked into the real chruby. Here is the commit where I fixed it: |
Actually, never mind; chruby.sh doesn't need to be changed. It seems risky to program chruby.sh to silently fail like I was suggesting. The approach that I now see on the README for chruby is probably better. It says to make a script in /etc/profile.d/ that sources chruby.sh if and only if the user is running bash or zsh. |
I think we can close this. |
@DavidEGrayson another problem is that every file would need the bash/zsh check. |
When using scripts/setup.sh to install chruby on Ubuntu 12.04 it adds /etc/profile.d/chruby.sh after which I can no longer login on Unity (regardless of my default shell, I tried both with bash and zsh). On my system I deleted /etc/profile.d/chruby.sh and added the source command to my ~/.zshrc and am now able to login without issue and use chruby.
The text was updated successfully, but these errors were encountered: