Bug 1479098 - bash in gnome-terminal doesn't start in user home
bash in gnome-terminal doesn't start in user home
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: gnome-terminal (Show other bugs)
26
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Matthias Clasen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-07 20:26 EDT by Jonas Thiem
Modified: 2017-08-09 04:20 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-08 13:06:43 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jonas Thiem 2017-08-07 20:26:27 EDT
Description of problem:

For some reason, on my newest Fedora 26 install when I open up a gnome-terminal with bash, the shell doesn't start in user home and it doesn't run ~/.bashrc and/or ~/.profile either. This is the output in a new terminal window:

-bash-4.4$ echo $SHELL
/bin/bash
-bash-4.4$ echo $HOME
/home/jonas
-bash-4.4$ pwd
/
-bash-4.4$ whoami
jonas
-bash-4.4$ source ~/.bashrc
jonas@localhost:/$ ls -la ~ | grep .bashrc
-rwxr-xr-x.   1 jonas jonas     5398 Aug  8 02:17 .bashrc
jonas@localhost:/$ ls -la ~ | grep .profile
-rwxr-xr-x.   1 jonas jonas       29 Feb 29  2016 .bash_profile
-rw-r--r--.   1 jonas jonas      675 Aug  8 02:15 .profile
jonas@localhost:/

Version-Release number of selected component (if applicable):
GNU bash, version 4.4.12(1)-release (x86_64-redhat-linux-gnu)

How reproducible:
100%

Steps to Reproduce:
1. Open gnome-terminal under default GNOME 3 Wayland session

Actual results:
source ~/.bashrc will change the prompt (which indicates it wasn't run before) and initial directory is /

Expected results:
source ~/.bashrc doesn't change prompt and initial directory is the user home ~


Additional info:
The home partition (/home) was transferred from a previous Fedora 26 install where this worked fine, I wiped / with a fresh install because I moved between hard disks and it was less effort than copying the / partition as well. Apart from this issue, everything else (including permissions in the user home) looks fine. /etc/profile is unmodified since the fresh install. SMART output of ssd looks good too and all other programs like firefox, thunderbird, .. appear to run perfectly fine with all old settings still there.
Comment 1 Jonas Thiem 2017-08-07 20:30:09 EDT
I just found out ~/.bash_profile didn't have source ~/.bashrc so that part is fixed now.

However, the bash shell still doesn't start out in my user home for some reason.
Comment 2 Kamil Dudka 2017-08-08 05:52:30 EDT
Does it happen with gnome-terminal only?

Please try other terminals (xterm, native tty, etc.).

Does the following command succeed in your gnome-terminal session?

$ cd "$HOME"
Comment 3 Jonas Thiem 2017-08-08 06:54:02 EDT
(In reply to Kamil Dudka from comment #2)
> Does it happen with gnome-terminal only?
> 
> Please try other terminals (xterm, native tty, etc.).

xterm and native tty work fine, only gnome-terminal appears to be affected for some odd reason.

> Does the following command succeed in your gnome-terminal session?
> 
> $ cd "$HOME"

Yes it does (I tried this in the affected gnome-terminal):

jonas@cyberman:/$ pwd
/
jonas@cyberman:/$ cd "$HOME"
jonas@cyberman:~$ pwd
/home/jonas
jonas@cyberman:~$
Comment 4 Kamil Dudka 2017-08-08 07:09:18 EDT
I suspect that gnome-terminal picks some stale data from $HOME from your previous installation.  Unfortunately, I do not use gnome-terminal myself.  So it is difficult for me to guess what happens.  I am switching the component...
Comment 5 Jonas Thiem 2017-08-08 13:06:43 EDT
I found the culprit: my home directory was unlabeled and not user_home_t as it should be. The TTY just worked because apparently I used the root login out of habit which didn't have those permission issues.
Comment 6 Kamil Dudka 2017-08-09 04:20:10 EDT
(In reply to Jonas Thiem from comment #5)
> I found the culprit: my home directory was unlabeled and not user_home_t

Thank you for clarifying it!

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