Rudolf,
Thanks for your explanation. However, I still think there is a flaw in
the "design".
For example, if I want to start tomcat automatically at bootup, I need
JAVA_HOME and CATALINA_HOME set. Same with hsqldb - it need a
HSQLDB_HOME environment variable set. Netbeans also needs JAVA_HOME and
NETBEANS_HOME.
So, does this mean I have to give up on gdm and type startx at a command
prompt to get these environment variables set? Seems crazy to me! I
guess I could put them in some global "X" file (not sure which one - any
suggestions?), but then I have to maintain my environment variables in
two places. This also seems crazy. Is there a global "X" file where I
can place ". /etc/profile", so at least I am only maintaining my
environment variables in one place?
Again, I am probably missing the real picture on this topic. I feel like
one of the blind men who describes the elephant as a snake whereas the
Linux gurus know an elephant is really shaped like a tree!
Mark
Rudolfo Munguia wrote:
>I don't believe that you are missing anything, it is just that certain
>things haven't been explained correctly.
>
>When you start a Terminal or Console it needs certain values set to be
>able to behave the way you require and those values are set using
>{.profile, .bash_profile, .cshrc, .sh, .bashrc, /etc/profile, etc.}.
>
>When you start X it normally begins in it's own sh environment and is
>devoid of any environment variables unless they are specified in the
>global or local {.xsession, .xinitrc, .Xresources,
>/etc/X11/(xdm/gdm)/.xinit, etc.}
>
>So in your previous statement where you see that your Window Manager
>has no environment variables set, but your terminal/console windows
>do, it is operating as designed.
>
>A word of caution, when setting environment variables globally for X,
>you also allow anyone who may exploit your box access to those same
>environment variables - possibly making it even easier for intruders
>to abuse your computer.
>
>On Sun, 19 Dec 2004 08:26:04 -0700, Mark Phillips
><mark@phillipsmarketing.biz> wrote:
>
>
>> Jeremy,
>>
>> Thanks again for your response. I am still missing something.
>>
>> My /home/mark/.xsession file (how strange that you know I use kde....)
>>
>> mark@latitude610:~$ cat .xsession
>> . /etc/profile
>> exec startkde
>> mark@latitude610:~$
>>
>> But when I try this, I still don't have my environment variables set:
>>
>> mark@latitude610:~$ echo $JAVA_HOME
>>
>> mark@latitude610:~$
>>
>> However, this works in a terminal window:
>>
>> mark@latitude610:~$ . /etc/profile
>> mark@latitude610:~$ echo $JAVA_HOME
>> /usr/local/lib/jdk
>> mark@latitude610:~$
>>
>> What am I missing, so that the environment variables are loaded when I
>>login? Is there a global place (like /etc/profile) where I can put my
>>environment variables and have them available when I login? I tried
>>rummaging around the gdm documentation and on the net, but I can't seem to
>>find out how to do this. That surprises me, since I would think this would
>>be a common problem and would have been solved already.
>>
>> I am also surprised that there isn't a way to do source /etc/profile in
>>gdm.conf. I looked at the gdm manual
>>(http://www.jirka.org/gdm-documentation/x241.html) and found this:
>> ----snip----
>> BaseXsession
>> BaseXsession=<etc>/gdm/Xsession
>>
>> This is the base X session file. When a user logs in, this script will be
>>run with the selected session as the first argument. The selected session
>>will be the Exec= from the .desktop file of the session.
>>
>> If you wish to use the same script for several different display managers,
>>and wish to have some of the script run only for GDM, then you can check the
>>presence of the GDMSESSION environmental variable. This will always be set
>>to the basename of .desktop (without the extension) file that is being used
>>for this session, and will only be set for GDM sessions. Previously some
>>scripts were checking for GDM_LANG, but that is only set when the user picks
>>a non-system default language.
>>
>> This script should take care of doing the "login" for the user and so it
>>should source the /etc/profile and friends. The standard script shipped with
>>GDM sources the files in this order: /etc/profile then ~/.profile then
>>/etc/xprofile and finally ~/.xprofile. Note that different distributions may
>>change this however. Sometimes users personal setup will be in
>>~/.bash_profile, however broken that is. ----snip----
>>
>> My gdm.conf has the entry BaseXsession= /etc/gdm/Xsession, and
>>/etc/gdm/Xsession does exist. It seems that Debian (my distro) must change
>>this process somehow since it does not source /etc/profile (see the last
>>paragraph).
>>
>> Boy, am I confused!
>>
>> Thanks!
>>
>>
>> Mark
>>
>> Jeremy C. Reed wrote:
>> On Sat, 18 Dec 2004, Mark Phillips wrote:
>> Thanks for your response....I tried the following and the environment
>>variables I set up in /etc/profile are still not being read: 1. Created a
>>file .xsession 2. Added these lines: . /etc/profile exec gdm Don't restart
>>the display manager. The display manager will run ~/.xsession. exec startkde
>># or exec blackbox # for example Jeremy C. Reed BSD News, BSD tutorials, BSD
>>links http://www.bsdnewsletter.com/
>>--------------------------------------------------- PLUG-discuss mailing
>>list - PLUG-discuss@lists.plug.phoenix.az.us To subscribe, unsubscribe, or
>>to change you mail settings:
>>http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>>
>>
>---------------------------------------------------
>PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
>To subscribe, unsubscribe, or to change you mail settings:
>http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>
>
>
---------------------------------------------------
PLUG-discuss mailing list -
PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss