Specifically, I'm trying to set KRB5CCNAME in $HOME/.profile, and it becomes available from a terminal session as expected, but it never gets set in Nautilus, where it is needed.
Looking at /etc/X11/xinit/xinitrc, that script sources another script which in turn sources $HOME/.profile, so as far as I can tell, this should work.
Could it be that the Nautilus server isn't started by the user's session itself? If so, how do I work around this?
> generally the Xsession wont touch .profile - there are exceptions.
> It's picking up stuff from /etc/X11/Xsession.d
> You can also use ~/.xsessionrc which is sourced from a file in
> /etc/X11/Xsession.d
> You probably dont want to source .bashrc directly, but you can create
> another file to hold environment variables and source it from
> .xsessionrc AND .bashrc/.profile
Thank you. I followed your recommendations but it does not seem to work.
I tried this by creating a file /etc/X11/Xsession.d/99xsession with the following content:
if [ -r "$HOME/.xsessionrc" ] ; then
. "$HOME/.xsessionrc"
fi
I then added some code in .xsessionrc that adds a log message to a file in /tmp. After this I sourced /etc/X11/Xsession.d/99xsession to confirm that the everything worked.
After rebooting the VM, the environment variable was not set, and there was no entry in the file in /tmp which is updated by the script.
From this I draw the conclusion that the scripts in /etc/X11/Xsession.d are not actually sourced when booting a VM.
Did I do something wrong, or is my analysis of the situation incorrect?
> You dont seem to have followed my recommendations :-(
Actually, I did. :-) Note that your recommendation works perfectly on Debian-9.
I'm using Fedora-26, and things are not as neat there.
> On a Debian system, sourcing user defined xessionrc is already set up -
> it is in /etc/X11/Xsession.d/40x11-common_xsessionrc.
> I suspect Fedora would have something similar.
Well, it doesn't seem to. On Fedroa there is only a single file in
/etc/X11/Xsession.d, and that is 60xbrlapi (which seems to have something
to do with braille output).
That's why I added my own to the fedora-26 template, with the content you
saw in my previous message.
But, even when doing this, the script wasn't run which suggests that the entire
Xsession.d mechanism does not work on Fedora-26. Again, on Debian-9 it works
exactly as you described.
> I'm not familiar with Fedora, but setting a variable in .profile DOES
> seem to expose it to nautilus, at least in a qube using a
> Fedora-26-minimal template.
> So can we take a step back and can you explain what variable you want
> set and how you expect it to affect nautilus use? That is, how would you
> judge that the variable has been set for nautilus?
That's odd. That's not my observation on Fedora-26.
What I try to set is KRB5CCNAME. This environment variable specifies the
path to the Kerberos ticket file that is needed for authentication to
SMB fileshares (in the specific case of Nautilus).
I have proved that the environment variable does not get set first and foremost
by noting that authentication doesn't work, and also by checking /proc/PID/environ
for the Nautilus process. This file contains the environment variables for
a given process.