I'm modifying the $HOME variable on a /etc/profile.d script. This seems to be OK for console sessions.
There are some caveats on graphical sessions, though: Gnome won't load my desktop configuration, it will still use the HOME defined on the passwd. Bizarre enough, If I open a terminal, the $HOME variable is the one defined by me on the /etc/profile.d script.
I'm doing this because I'm rsyncing the home against a NFS server, and I want to provide an alternative login method by mounting the NFS home directly, for occasional logins. Since at this stage root has already created the home directory, my plan is to link the NFS mount inside it, and modify the $HOME variable.
startxin a running shell? If not, GNOME won't even dream about the contents of/etc/profile.d, as this is used by shells. You may want to change some file (~/.xprofileor its system-wide counterpart?) if you are using a graphical login screen. Meanwhile, I'm curious, why don't you just change /etc/passwd to point to what you want $HOME to be, or why don't you simply mount the NFS folder over/homeor wherever your system has home directories? – njsg Jan 28 at 18:44/etc/profile.d/are run because I'm doing other stuff and it's actually being done. I can't change/etc/passwdbecausepasswdis gathered from a LDAP server. I do this on 2 steps: The first step as root, run throughpam_exec, mounts the NFS share elsewhere and ensures that the home directory exists. The second step as user, runs through/etc/profile.dscripts and does the rsyncing or the linking stuff. Since the user directory already exists and the parent is owned by root, I can't delete it and replace it by a link. – Jorge Suárez de Lis Jan 28 at 19:50/etc/profile.d/is run? Is there any graphical application that you don't start from a terminal emulator and which does have the updated values? – njsg Jan 28 at 21:58yaddialog showing the progress of the rsync. It's called from a/etc/profile.d/script, and it's being displayed. Also, the rsync is done, so... – Jorge Suárez de Lis Jan 28 at 22:22