gnome-terminal starts in / for user account on second disk

Issues related to applications and software problems
Post Reply
ohw0571
Posts: 127
Joined: 2008/10/05 12:24:17

gnome-terminal starts in / for user account on second disk

Post by ohw0571 » 2011/09/14 07:52:19

Hello,

when installing the first test system with CentOS6, I came across a strange behaviour of gnome-terminal. If a user's home directory lives on a partition of the second disk (mounted on /usr/people in my case - a reminiscence of good old SGI times), gnome-terminal will start in the root directory (/) instead of $HOME (~). This does not happen with users residing on the root partition (i.e. /home or anything else). The $HOME environment is properly defined, and indeed, a "cd" command in the terminal has the expected result.
Any ideas what might be causing this?
Of course one can define a new shortcut launching something like "gnome-terminal --working-directory=~", but this shouldn't actually be necessary :-(

Cheers,
Oliver

ohw0571
Posts: 127
Joined: 2008/10/05 12:24:17

Re: gnome-terminal starts in / for user account on second disk

Post by ohw0571 » 2011/09/15 14:40:15

After a lot of research, it has turned out to be an SElinux problem! After turning to permissive mode, the problem disappeared.

[rant]
If you find some really inexplicable behaviour, think of SElinux first - yes, it is basically a good concept in terms of security, but I frankly admit that I hate it in its current state!
[/rant]

So it looks like anything but the default /home causes problems with SElinux because the user directories are not labelled correctly. /home has type "home_root_t", user directories have "user_home_dir_t" and files therein typically have "user_home_t".
Unfortunately, after labelling my /usr/people directory as "home_root_t" and re-creating users, their directories will still get "usr_t" (inherited from /usr) instead of the desired "user_home_dir_t".

Is there a smart way to define a home directory other than /home such that user directories (and files) are created with correct labels?
I searched a lot about this topic but couldn't find a handy solution :-(

Thanks in advance
Oliver

User avatar
TrevorH
Site Admin
Posts: 33221
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: gnome-terminal starts in / for user account on second disk

Post by TrevorH » 2011/09/15 15:02:26

man semanage

then look for fcontext, especially in the examples at the end

Post Reply