I have a new installation of Arch/KDE. I'm using KDM to login started with inittab (I couldn't make it work with systemd).
I installed oracle jre from AUR. It installs the file /etc/profile.d/jre.sh which exports jre path, but in konsole I am not able to run java or javac. However if I login in a tty the file is sourced correctly (I have jre binaries in PATH).
In konsole I'm using zsh, but the same occurs with bash.
Anyone experienced this?
Basically, it depends on the files the particular shells read at start up and this differs for login versus non-login shells, for example. These files are sourced for me but I have tweaked config files which ensure that /etc/profile is always sourced. If you ensure that, it will all work because that file will source the fragments in profile.d.
For example, I use
if [ -f "/etc/profile" ] then [ -r /etc/profile ] && . /etc/profile fi
in ~/.profile and
[[ -f ~/.profile ]] && . ~/.profile [[ -f ~/.bashrc ]] && . ~/.bashrc
Obviously you may prefer a different set up.
@cfr, you know you can simply use
[[ -f /etc/profile ]] && . /etc/profile
instead of the if/then statement. It will work either way, but I use the one liner because it makes my .xinitrc look a little cleaner.
Yes. But I probably didn't when I originally wrote this. My config files have sort of migrated with me from machine to machine so there are bits which reflect what I now know (and don't know) and bits which reflect what I knew some time back (and didn't know). And then there are bits which I've half-updated, commented out etc. etc.
Your statement wouldn't be equivalent to what I have although I admit that that would not matter here.
Anyway, apparently the relevant bit of my .bash_profile is newer than the relevant bit of my .profile...
My config files are a mess which I am some day going to have to untangle... (I can't remember when I last used tcsh as an actual shell - as opposed to a script which still uses it - but my sh, bash and tcsh environments are still being automatically synced. This is from when Apple switched the default shell in OS X to bash.)
EDIT: actually .profile must just be older than .bash_profile as it is all written like this.
Last edited by cfr (2012-10-13 23:00:44)
I think the problem is related with KDM. In previous installations /etc/profile sourced automatically
It didn't source that automatically for me if I had e.g. ~/.profile at all. Maybe you've added a config file and that's causing the change in behaviour?