Red Hat Bugzilla – Bug 1479098
bash in gnome-terminal doesn't start in user home
Last modified: 2017-08-09 04:20:10 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
-bash-4.4$ echo $HOME
-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
Version-Release number of selected component (if applicable):
GNU bash, version 4.4.12(1)-release (x86_64-redhat-linux-gnu)
Steps to Reproduce:
1. Open gnome-terminal under default GNOME 3 Wayland session
source ~/.bashrc will change the prompt (which indicates it wasn't run before) and initial directory is /
source ~/.bashrc doesn't change prompt and initial directory is the user home ~
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.
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.
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"
(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:/$ cd "$HOME"
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...
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.
(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!