This started with trying to change my EDITOR variable. In /etc/rc.conf I set the variable to /usr/bin/xemacs I opened a new xterm and the variable was still set to /usr/bin/emacs (the old setting). I tried to manually source /etc/profile but it still didn't update the variable. I then checked /etc/profile and noticed that EDITOR is only set from /etc/rc.conf if it is currently blank. I do not set EDITOR in .bashrc or .bash_profile, nor is it set under /etc/env.d or anywhere else I can think of. Well, after a reboot, /usr/bin/xemacs wan initialized correctly. However, I was able to determine that it is still being set before /etc/profile can set it frome /etc/rc.conf. Another issue I found was that settings in root's ~/.bashrc are not effective. I added a few aliases and non of them function. And yes I'm doing a su - and I've done a source /etc/profile. Also, with the regular user, changing an alias in .bashrc would not be initialized by source /etc/profile. When I opened a new xterm the alias would then work. Reproducible: Always Steps to Reproduce: rc.conf problem: 1. set EDITOR 2. source /etc/profile 3. EDITOR still old setting 4. Reboot 5. EDITOR is now new setting User .bashrc 1. Add alias 2. source /etc/profile 3. alias not functional 4. open new xterm 5. alias functional root .bashrc 1. add alias 2. su -; source /etc/profile 3. alias not functional 4. logging into a regular terminal instead of xterm doesn't have alias functionality either
when you launched a new xterm it probably took $EDITOR from your active environment which means it ignored the new setting ... as for ~/.bashrc, it's probably because `su -` invoked a new login shell which means ~/.bash_login would have been read and not ~/.bashrc ---> not a bug
The previous comment was correct. I misunderstood the role of /etc/profile in all of this. Using .bash_login fixes my root problem and I guess EDITOR is set only once by the xdm. Thanks for the clarification.