Bug 1487662 - /etc/bashrc is not sourced by login shells
Summary: /etc/bashrc is not sourced by login shells
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: setup
Version: rawhide
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Ondrej Vasik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-01 14:22 UTC by Adam Williamson
Modified: 2017-09-07 19:24 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-09-07 19:24:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Adam Williamson 2017-09-01 14:22:10 UTC
In the Fedora-Rawhide-20170830.n.1 compose, when we run an install where we create a regular user then boot and log in as that user, the bash prompt shows up as the default 'bash-4.4 $' prompt, meaning that sourcing of the Fedora bash config didn't work correctly.

There were two obviously related changes which landed in that compose, one to setup:

https://pagure.io/setup/c/be2c86a2fc92d18cfa326225a9d5c59a3b03a8b2?branch=master

and one to bash:

http://pkgs.fedoraproject.org/rpms/bash/c/a37e6bcc6c04bb78af3ac704f4ecce323406809d?branch=master

It seems likely that one or both of these is the source of the problem.

To reproduce, grab https://kojipkgs.fedoraproject.org/compose/rawhide/Fedora-Rawhide-20170830.n.1/compose/Server/x86_64/iso/Fedora-Server-dvd-x86_64-Rawhide-20170830.n.1.iso , run an install (creating a user account along the way), then boot the system and try to log in as the user you created. You should see the bug there. It may well show up any time a regular user logs in with that bash package, of course, I just know that specific case definitely triggers the bug.

Comment 1 Siteshwar Vashisht 2017-09-04 14:10:17 UTC
This regression was introduced by fix for bug 1193590. /etc/bashrc is not sourced by login shells.

Comment 2 Siteshwar Vashisht 2017-09-04 14:14:46 UTC
This is a design decision taken by upstream to not source bashrc files for login shells. We need to find a workaround for it. Before bash-4.4.12-11 /etc/bashrc was sourced by ~/.bashrc and ~/.bashrc was sourced in ~/.bash_profile. So sourcing for /etc/bashrc worked that way.

Comment 3 Siteshwar Vashisht 2017-09-04 14:22:20 UTC
We can workaround this bug by sourcing /etc/bashrc in /etc/profile. However since /etc/profile is used by different shells, we should put a check for sourcing /etc/bashrc for bash only.

Comment 4 Ondrej Vasik 2017-09-05 14:31:53 UTC
This was already done in Rawhide, will do an update for F27 once the fix is confirmed.

Comment 5 Adam Williamson 2017-09-05 17:00:58 UTC
Thanks, just waiting on a successful Rawhide compose to see.

Comment 6 Fedora Update System 2017-09-07 09:21:43 UTC
setup-2.10.10-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-9e0caa3222

Comment 7 Fedora Update System 2017-09-07 14:33:55 UTC
setup-2.10.10-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-9e0caa3222

Comment 8 Adam Williamson 2017-09-07 19:24:53 UTC
Welp, with recent Rawhide this indeed looks OK:

https://openqa.fedoraproject.org/tests/138632#step/_console_wait_login/6

and the bug never actually hit F27 due to the freeze, so I don't think we need to associate this bug with the F27 update. We can just close it. I'll edit the association out of the update.


Note You need to log in before you can comment on or make changes to this bug.