[Bug 1052182] New: Login bash shells no longer read .bashrc
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182 Bug ID: 1052182 Summary: Login bash shells no longer read .bashrc Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: x86-64 OS: SUSE Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem Assignee: bnc-team-screening@forge.provo.novell.com Reporter: kyrimis@alumni.princeton.edu QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- After the 20170802 update, login shells no longer read .bashrc. Could this be because of a change in aaa_base-13.2+git20170731.c10ca77-1.1 ? I worked around this by adding "source ~/.bashrc" in my .profile, but I'm not sure that this is the best way: until today, I never had to do something special, to get .bashrc read from a login shell, either in OpenSUSE or in Red Hat's offerings. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182#c1
Ron Lovell
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182#c2
--- Comment #2 from Kriton Kyrimis
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
Felix Miata
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182#c3
Roger Whittaker
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182#c4
Lucifer Watson
Wouldn't it be simpler to remove the line "unset is" in /etc/bash.bashrc (line 365), which was introduced in the latest update, as this seems to be the source of the problem? I commented it out, and my .bashrc is being read again, without having to source it in my .profile.
Thank you. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182#c5
--- Comment #5 from Ron Lovell
Wouldn't it be simpler to remove the line "unset is" in /etc/bash.bashrc ...
Yes, that seems simplest. There is a suble difference, however. I found by testing that /etc/bash.bashrc is sourced for new non-login interactive shells. (I haven't been able to figure out how. My ~/.bashrc doesn't source /etc/bash.bashrc.) So if the 'unset is' is uncommented, then $is will be set in the new shell. Example, starting with a login interactive shell: $ echo $is $ bash $ echo $is bash It's hard to imagine how this could cause a problem, but I just wanted to mention it for the maintainer to consider. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182#c6
--- Comment #6 from Ron Lovell
(In reply to Kriton Kyrimis from comment #2)
Wouldn't it be simpler to remove the line "unset is" in /etc/bash.bashrc ...
Yes, that seems simplest. So if the 'unset is' is uncommented, then $is will be set in the new shell. Example, starting with a login interactive shell:
$ echo $is
$ bash $ echo $is bash
It's hard to imagine how this could cause a problem, but I just wanted to mention it for the maintainer to consider.
Correction: Meant to say: So if the 'unset is' is COMMENTED OUT, then ... -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182#c7
--- Comment #7 from Ron Lovell
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182#c8
--- Comment #8 from Ron Lovell
BTW, I tracked down how bash.bashrc is getting sourced for non-login shells.
Another correction: I meant to say: ... uncomment this line: /* #define SYS_BASHRC "/etc/bash.bashrc" */ I apologize for these mistakes. I'll try to do better. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182#c9
--- Comment #9 from Kriton Kyrimis
So if the 'unset is' is commented out, then $is will be set in the new shell.
Perhaps this is what they wanted to correct by unsetting is, except that they did it too early, while the variable was still needed. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182#c10
--- Comment #10 from Ron Lovell
(In reply to Ron Lovell from comment #5)
So if the 'unset is' is commented out, then $is will be set in the new shell.
Perhaps this is what they wanted to correct by unsetting is, except that they did it too early, while the variable was still needed.
Agreed. Here's an idea for a minimalist change to bash.bashrc. At top, before the 'test -z "$is"; then' statement, save 'is' if it is set (not just non-null), otherwise save 'unset': _is_save=${is-"unset"} if test -z "$is" ; then ... as before ... At the end, where 'is' is unset, substitute: if test "$_is_save" = "unset" ; then unset is fi unset _is_save -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182#c11
--- Comment #11 from Kriton Kyrimis
Agreed. Here's an idea for a minimalist change to bash.bashrc.
Seems to work great! .bashrc is sourced, and neither is or _is_save persists in login or non-login shells. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
Andreas Schneider
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182#c16
--- Comment #16 from Ron Lovell
Created attachment 735703 [details] Collect the ideas in one commit for aaa_base ...
any suggestions, criticism, and/or comments one this one?
This should work. It's a different design, with changes to both /etc/profile and /etc/bash.bashrc. (I was proposing a change to bash.bashrc only.) The patch seems to correctly handle sourcing bash.bashrc from profile, as well as bash.bashrc read directly by bash for non-login shells. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182#c17
--- Comment #17 from Ron Lovell
(In reply to Dr. Werner Fink from comment #13)
Created attachment 735703 [details] Collect the ideas in one commit for aaa_base ...
any suggestions, criticism, and/or comments one this one?
This should work. It's a different design, with changes to both /etc/profile and /etc/bash.bashrc. (I was proposing a change to bash.bashrc only.) The patch seems to correctly handle sourcing bash.bashrc from profile, as well as bash.bashrc read directly by bash for non-login shells.
Actually, with the change to /etc/profile, is the change to bash.bashrc even needed? I should have made it clearer that the proposed change to bash.bashrc in comment #10 was an ALTERNATIVE to the change to profile in comment #1, not a supplement to it. If you tried to use them both, that wouldn't have worked. With the change to profile, it's fine that bash.bashrc unsets 's', and that would be expected action if, for example, bash.bashrc is sourced by a user from her ~/.bashrc (as is done in Fedora). I'm still staring at the patch, but unless I'm missing something, the change to bash.bashrc looks redundant. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
Olivier Nicolas
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
Arvin Schnell
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182#c19
Jacob W
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182#c21
--- Comment #21 from Ron Lovell
(In reply to Jacob W from comment #19)
There have been multiple solutions presented. Personally, I think it's imperative that the solution works where .bashrc is sourced by both login and non-login shells, like comment #11
Why hasn't this (or similar) solution been committed already? This bug is driving me crazy - especially when generating new servers.
AFAICS from Base:System/aaa_base it is committed ... here I have in /etc/profile in line 341ff
if test "$is" != ksh -a "$is" != zsh ; then _is_save=$is test -r /etc/bash.bashrc && . /etc/bash.bashrc is=$_is_save unset _is_save fi
that should help the lines below to source $HOME/.bashrc
Yes, on my Tumbleweed system the fix came with aaa_base 13.2+git20170814.cc9e34e-1.1 in snapshot 20170830. Don't know status in Leaps. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182#c24
Dr. Werner Fink
Can we have the status of this bug changed?
ACK, setting it to fixed. Thanks for reporting, debugging and your code -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1052182
Dr. Werner Fink
participants (1)
-
bugzilla_noreply@novell.com