Summary: | environment variables are different whether you use a graphical login or a console login | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Cédric Paquot <cedric.paquot> |
Component: | Current packages | Assignee: | Martin Schlemmer (RETIRED) <azarah> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | ahbritto, alain, cedric.paquot, converter42, danarmak, jeld, sciack, vapier |
Priority: | High | ||
Version: | 1.3 | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 5629 |
Description
Cédric Paquot
2002-07-28 17:36:01 UTC
Ok. In fact. Take a look at this bug: http://bugs.gentoo.org/show_bug.cgi?id=5629 It is related. :) You have found the same bug as I, but in my case I have a shell (bash) specified in my /etc/passwd. I always use the "useradd" command with the "-s" option. Now right click in the gnome terminal, and check "run as login command" or similar under preferences/"edit current profile". If KDE, start konsole with "konsole -l" i think. Hi, azarah it is not a fix... :) the problem is in the SHELL variable no exported correctly. Anyway, i cannot do what you said, cos the gnome-terminal closes itself a a couple of seconds, so i dont have time to do wut u said. Anyway i'll keep on investigating... bye I did some testing of my own. This is only true if no shell is defined in /etc/passwd. That still do not really change the fact that you need one defined =) It may bring us to the question why adduser do not add a shell by default ... security maybe (as you dont want a valid shell for daemons, etc and the system should not assume stuff. Also the pam_shell.so module is an interesting one ...)? Excuse me but what are you talking about? The problem is definitely not a missing shell in the /etc/passwd file. I have one specified (with useradd -s /bin/bash). The problem is when you login via kdm instead of the console (text mode). Look at the description I wrote, you'll see that the environment variables aren't set properly with a kdm login. Comment #5 was more for Mauro Sciaccaluga. I know your variables is different .. it is because the terminal is not started as a LOGIN shell. Now read above (comment #3) how to do that, or ask a KDE/Gnome expert in #gentoo. OK I understand what you say :-) ... but I still think the problem I reported persists. Why? Because I first noticed the problem when konqueror couldn't start java for a web page, or Qt Assistant refused to start, although I had launched these applications using the icons in kde. So you're solution is to open a terminal as a LOGIN shell (as I understand) and start my app within this terminal instead of using the icons??? azarah: this bug still persists, it is not resolved!! The problem is not ADDUSER. As I already told you, if you do an adduser and you try to login with the simple console login the SHELL variable is set (even if in /etc/passwd isnt) to a default /bin/sh, but if you login with a grphical login manager like gdm or kdm, the SHELL environment is not being pointed to a default /bin/sh like the simple LOGIN does. Can u understand me? So the bug is not resolved at all :) >>azarah: The bug is not resolved at all ! You can read all I wrote and especially the comment 8 (http://bugs.gentoo.org/show_bug.cgi?id=5699#c8) and you'll see that it has _nothing_ to do with adduser. So please reopen this bug! OK, OK, so maybe I was a bit hasty when I closed it :P It basically is because a "login" never occurs. Now, In a perfect world you would expect gdm/kdm to do a "login", but they never do. This is why /etc/profile do not get sourced. If you thus do not have a shell set in /etc/passwd, then your $SHELL will be missing. You need one. As for the rest of the env variables ... must admit I do not have the official answer on this. I just still think it is bad to always source it in .bashrc. Another way could be to change the first lines of the Session files in /etc/X11/Sessions/ from: #!/bin/sh to: #!/bin/sh --login Although it is not the best one out there. I changed the first line of /etc/X11/Sessions/kde-3.0.2 from #!/bin/sh to #!/bin/sh --login and my problems are gone! Thank you azarah! But as you said it seems more like a hack than a fix. So don't close this bug too quickly ;-) Dan, this is not the first bug that suggest the "--login" part to our Session files. Thoughts against making it default ? Similar bugs: http://bugs.gentoo.org/show_bug.cgi?id=4313 http://bugs.gentoo.org/show_bug.cgi?id=4955 http://bugs.gentoo.org/show_bug.cgi?id=5629 http://bugs.gentoo.org/show_bug.cgi?id=5683 http://bugs.gentoo.org/show_bug.cgi?id=5699 everyone has something diff to say ... think it should all be wrapped up and put into 1 bundle though ;) The startkde script already has bash --login as its interpreter. So I don't quite understand why adding it to the seession file too would change anything? A KDE session is already a login one (and for konsole you have to run it as konsole -ls regardless of kde's environment). But I have to admit I haven't read through all the comments... Anyway I don't see any reason not to do it, it should be ok afaics. *** Bug 4955 has been marked as a duplicate of this bug. *** Ok... but wut about GDM? :) Same thing. Add to whatever you use in /etc/X11/Sessions/ a '--login' Changed the shell for /etc/X11/xdm/Xsession and /etc/X11/gdm/PreSession/Default to "/bin/bash --login". Please check the ChangeLogs, and then remerge them (xfree-4.2.1-r2, gdm). *** Bug 13579 has been marked as a duplicate of this bug. *** Ok, I disagree with this thread in general. Adding --login left and right may work, but it doesn't solve the original problem: the scripts should be setup such that the non-login scripts (e.g. csh.cshrc) setup everything that's needed for a non-login shell to function properly. I haven't looked at the bash scripts, but at least the tcsh scripts that come with gentoo (csh.cshrc and csh.login) are in need of a serious overhaul. Take a look at how RedHat and SuSE handle this to see what I mean. |