Bug 1388776

Summary: .bash_profile not executed anymore
Product: [Fedora] Fedora Reporter: Remi Collet <rcollet>
Component: waylandAssignee: Adam Jackson <ajax>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: ajax, berend.de.schouwer, carwyn, drfudgeboy, fedora, feng.haibo, lars, luto, nyh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-12 10:48:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Remi Collet 2016-10-26 07:49:42 UTC
Using "Gnome on Xorg" (and all other WM) executes .bash_profile, which allow users to configure their environment.

This will be inherited in all terminal or other bash sessions created later.

Some applications have a bash launcher (e.g. Firefox), which may take care of some env variables.

Using "Gnome on wayland", .bash_profile is not run, which raise some strange issues (e.g. I lost most of my history because of missing HISTSIZE value, and gcc doesn't work  because of missing directory, created in a tmpfs).

I known most of this can be done some other way
- tpmfiles to creeate directories
- .bashrc
- etc

BTW, I think using .bash_profile is a common/good practice used for years.

Else, we probably need some GUI to be able to configure such variable.

Comment 1 FENG Haibo 2016-11-04 03:19:33 UTC
The same issue is ever reported for Fedora 23, see Bug 1301515.

I installed fedora 23 from new, didn't meet this issue, dnf upgrade to Fedora 24 it is also fine. This time I hit it after dnf upgrade to Fedora beta. So it seems there is some bug in the dnf upgrade, it changed the user's gnome terminal setting.

Comment 2 FENG Haibo 2016-11-04 03:21:26 UTC
(In reply to FENG Haibo from comment #1)
> The same issue is ever reported for Fedora 23, see Bug 1301515.
> 
> I installed fedora 23 from new, didn't meet this issue, dnf upgrade to
> Fedora 24 it is also fine. This time I hit it after dnf upgrade to Fedora
> beta. So it seems there is some bug in the dnf upgrade, it changed the
> user's gnome terminal setting.

Should be "upgrade to Fedora 25 beta"

Comment 3 Carwyn Edwards 2016-11-09 02:39:07 UTC
I can confirm this issue, under Xorg .bash_profile is applied, under wayland it is not.

Comment 4 Carwyn Edwards 2016-11-09 02:48:26 UTC
This is on Fedora 25 updated as of Nov 9th, .profile isn't read in lieu of .bash_profile either under wayland.

Workaround is to force gnome-terminal to "Run command as a login shell."

Comment 5 James Heather 2016-11-15 11:41:21 UTC
I'm seeing this too.

My workaround is to "source ~/.bash_profile" whenever I open a terminal, but it's not much fun.

Comment 6 Carwyn Edwards 2016-11-15 13:54:26 UTC
The problem with just forcing terminals to be login shells or sourcing .bash_profile is that graphical applications launched from gnome-shell don't inherit the environment. In my case atom editor and having $GOPATH in scope means that none of the Go add-ons work, this will likely be similar for other applications too.

Comment 7 Andy Lutomirski 2016-11-23 19:40:50 UTC
I tried to figure out what's going on and I got lost.  /usr/share/xsessions/gnome.desktop and gnome-xorg.desktop appear to be identical except for their "Name" entries.  That makes debugging *real* fun.

Comment 8 James Heather 2016-11-25 09:43:56 UTC
Is anything happening with this? Fedora 25 has now been released, and this will be causing trouble.

Comment 9 Remi Collet 2016-11-25 11:13:04 UTC
Upstream https://bugzilla.gnome.org/show_bug.cgi?id=736660

Comment 10 Nadav Har'El 2016-12-06 13:48:09 UTC
The upstream GNOME bug (linked in comment 9) has existed for more than two years (!!) and clearly they don't want to fix it. The GNOME developers, perhaps unsurprisingly, only care about GNOME and its GUI applications, none of which use environment variables, so they couldn't care less, apparently, that ~/.profile (et al.) suddenly stopped working.

Fedora doesn't need to take this abuse from GNOME, and can fix it for Fedora users who use *both* GUI applications and "old school" shells and command line tools. I outlined an easy fix in the upstream bug: in the script /usr/bin/gnome-session, where we currently have the line:

exec /usr/libexec/gnome-session-binary "$@"

replace it by something like:

exec -l $SHELL -c "exec /usr/libexec/gnome-session-binary $*"

Or more safely (checking $SHELL for sanity),

$SHELL -c "exec /usr/bin/true" && exec -l $SHELL -c exec "/usr/libexec/gnome-session-binary $*" || exec /usr/libexec/gnome-session-binary "$@"

Fedora made this "GNOME on Wayland" the default on Fedora 25, so it can't wait another two years for GNOME to make this fix (if they ever do), and needs to patch this script on its own.

Comment 11 Nadav Har'El 2016-12-07 13:06:46 UTC
See also bug #1149905 which appears to be the same bug, and 2 year old (!).

Comment 12 Fedora End Of Life 2017-11-16 18:37:14 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 13 Fedora End Of Life 2017-12-12 10:48:16 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.