[CentOS] Cannot get LD_LIBRARY_PATH to work under NX (freenx)

2009-06-08 Thread Andrzej Szymanski
Hello,

I'm trying to get the LD_LIBRARY_PATH set from .bash_profile (Centos 5.3 
fully updated).

This is a part of my .bash_profile:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/szyman/omnet/omnetpp-2.3p1/lib
export R_HISTSIZE=20

Everything works fine under standard ssh login, but under NX client the 
LD_LIBRARY_PATH variable is missing (the R_HISTSIZE is exported properly).

Any hints?

Thanks,
Andrzej

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Cannot get LD_LIBRARY_PATH to work under NX (freenx)

2009-06-08 Thread Filipe Brandenburger
Hi,

On Mon, Jun 8, 2009 at 14:38, Andrzej Szymanskiszym...@agh.edu.pl wrote:
 Everything works fine under standard ssh login, but under NX client the
 LD_LIBRARY_PATH variable is missing (the R_HISTSIZE is exported properly).

 Any hints?

This is probably not related to NX, but to the terminal emulator you
are using (gnome-terminal, kterm, etc.). Some of them do not open
login shells (the ones that read .bash_profile) but only
interactive shells (the ones that read .bashrc).

Moving those lines from .bash_profile to .bashrc should work for both
cases (as .bash_profile usually sources .bashrc) and solve your
problem in both SSH sessions and NX sessions.

HTH,
Filipe
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Cannot get LD_LIBRARY_PATH to work under NX (freenx)

2009-06-08 Thread Andrzej Szymanski
Filipe Brandenburger wrote:
 Hi,
 
 On Mon, Jun 8, 2009 at 14:38, Andrzej Szymanskiszym...@agh.edu.pl wrote:
 Everything works fine under standard ssh login, but under NX client the
 LD_LIBRARY_PATH variable is missing (the R_HISTSIZE is exported properly).

 Any hints?
 
 This is probably not related to NX, but to the terminal emulator you
 are using (gnome-terminal, kterm, etc.). Some of them do not open
 login shells (the ones that read .bash_profile) but only
 interactive shells (the ones that read .bashrc).
 
 Moving those lines from .bash_profile to .bashrc should work for both
 cases (as .bash_profile usually sources .bashrc) and solve your
 problem in both SSH sessions and NX sessions.
 
 HTH,
 Filipe

Thanks for a fast resolution.

However, moving this to .bashrc is a workaround. If I log in graphically 
to the console the LD_LIBRARY_PATH from .bash_profile is set correctly. 
It is unset only on NX session (and the other settings from 
.bash_profile are set properly, so this file is definitely parsed during 
nx session startup).

Andrzej
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Cannot get LD_LIBRARY_PATH to work under NX (freenx)

2009-06-08 Thread Louis Lagendijk
On Mon, 2009-06-08 at 21:04 +0200, Andrzej Szymanski wrote:

 Thanks for a fast resolution.
 
 However, moving this to .bashrc is a workaround. If I log in graphically 
 to the console the LD_LIBRARY_PATH from .bash_profile is set correctly. 
 It is unset only on NX session (and the other settings from 
 .bash_profile are set properly, so this file is definitely parsed during 
 nx session startup).
As suggested before some terminals do not run as login-shell.
Gnome-terminal has an option (under edit- profile preferences - title
and command that allows you to change this behaviour: Run command as
login shell. You may want to check your terminal program for a similar
setting
Louis


___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Cannot get LD_LIBRARY_PATH to work under NX (freenx)

2009-06-08 Thread Jeff
On Mon, Jun 8, 2009 at 2:04 PM, Andrzej Szymanskiszym...@agh.edu.pl wrote:
 Filipe Brandenburger wrote:
 Hi,

 On Mon, Jun 8, 2009 at 14:38, Andrzej Szymanskiszym...@agh.edu.pl wrote:
 Everything works fine under standard ssh login, but under NX client the
 LD_LIBRARY_PATH variable is missing (the R_HISTSIZE is exported properly).

 Any hints?

 This is probably not related to NX, but to the terminal emulator you
 are using (gnome-terminal, kterm, etc.). Some of them do not open
 login shells (the ones that read .bash_profile) but only
 interactive shells (the ones that read .bashrc).

 Moving those lines from .bash_profile to .bashrc should work for both
 cases (as .bash_profile usually sources .bashrc) and solve your
 problem in both SSH sessions and NX sessions.

 HTH,
 Filipe

 Thanks for a fast resolution.

 However, moving this to .bashrc is a workaround. If I log in graphically
 to the console the LD_LIBRARY_PATH from .bash_profile is set correctly.
 It is unset only on NX session (and the other settings from
 .bash_profile are set properly, so this file is definitely parsed during
 nx session startup).

Can you just skip the whole LD_LIBRARY_PATH thing and configure
libraries at the system level?

man ldconfig

Jeff
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Cannot get LD_LIBRARY_PATH to work under NX (freenx)

2009-06-08 Thread Filipe Brandenburger
Hi,

On Mon, Jun 8, 2009 at 15:04, Andrzej Szymanskiszym...@agh.edu.pl wrote:
 However, moving this to .bashrc is a workaround. If I log in graphically
 to the console the LD_LIBRARY_PATH from .bash_profile is set correctly.
 It is unset only on NX session (and the other settings from
 .bash_profile are set properly, so this file is definitely parsed during
 nx session startup).

I use the real NX, not FreeNX, and I know it installs under /usr/NX,
so I know it will use LD_LIBRARY_PATH to find its own libraries. I
believe it will probably reset (erase) the contents of LD_LIBRARY_PATH
once the O.S. processes (window manager, etc.) are started.

As I said, if your terminal emulator opened a login shell you would
not have problems leaving the setting in .bash_profile, as it would be
read again when you open a new shell (if you are starting your
application through a shell). However, I believe this is not really
very standardized. As a rule of thumb, I try to put as much as
possible in .bashrc and leave only the source of .bashrc in
.bash_profile, as this increases the chances of it just working.

And while you say moving this to .bashrc is a workaround, I would
say that using LD_LIBRARY_PATH is a workaround, or at least a kludge,
since software that is properly installed would never need it... The
interaction of different software packages that need to use it will
always cause this kind of issues, and there is usually nothing much
short of other workarounds or kludges that can be done about it...

Filipe
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Cannot get LD_LIBRARY_PATH to work under NX (freenx)

2009-06-08 Thread Gary Greene
 -Original Message-
 From: centos-boun...@centos.org 
 [mailto:centos-boun...@centos.org] On Behalf Of Louis Lagendijk
 Sent: Monday, June 08, 2009 12:21 PM
 To: CentOS mailing list
 Subject: Re: [CentOS] Cannot get LD_LIBRARY_PATH to work 
 under NX (freenx)
 
 On Mon, 2009-06-08 at 21:04 +0200, Andrzej Szymanski wrote:
 
  Thanks for a fast resolution.
  
  However, moving this to .bashrc is a workaround. If I log 
 in graphically 
  to the console the LD_LIBRARY_PATH from .bash_profile is 
 set correctly. 
  It is unset only on NX session (and the other settings from 
  .bash_profile are set properly, so this file is definitely 
 parsed during 
  nx session startup).
 As suggested before some terminals do not run as login-shell.
 Gnome-terminal has an option (under edit- profile 
 preferences - title
 and command that allows you to change this behaviour: Run command as
 login shell. You may want to check your terminal program for a similar
 setting
 Louis
 
 
 ___
 CentOS mailing list
 CentOS@centos.org
 http://lists.centos.org/mailman/listinfo/centos
 

With Konsole, just change the invocation of /bin/bash to /bin/bash -l

--
Gary L. Greene, Jr.
IT Operations
Minerva Networks, Inc.
Cell:  (650) 704-6633
Phone: (408) 240-1239
 
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Cannot get LD_LIBRARY_PATH to work under NX (freenx)

2009-06-08 Thread Gary Greene
I'm surprised that since it installs in a non-standard location that it doesn't 
create a /etc/ld.so.conf.d/ conf file. In that case it's a simple drop-in file 
that only requires ldconfig to be run after the package installation

--
Gary L. Greene, Jr.
IT Operations
Minerva Networks, Inc.
Cell:  (650) 704-6633
Phone: (408) 240-1239
 

 -Original Message-
 From: centos-boun...@centos.org 
 [mailto:centos-boun...@centos.org] On Behalf Of Filipe Brandenburger
 Sent: Monday, June 08, 2009 12:26 PM
 To: CentOS mailing list
 Subject: Re: [CentOS] Cannot get LD_LIBRARY_PATH to work 
 under NX (freenx)
 
 Hi,
 
 On Mon, Jun 8, 2009 at 15:04, Andrzej 
 Szymanskiszym...@agh.edu.pl wrote:
  However, moving this to .bashrc is a workaround. If I log 
 in graphically
  to the console the LD_LIBRARY_PATH from .bash_profile is 
 set correctly.
  It is unset only on NX session (and the other settings from
  .bash_profile are set properly, so this file is definitely 
 parsed during
  nx session startup).
 
 I use the real NX, not FreeNX, and I know it installs under /usr/NX,
 so I know it will use LD_LIBRARY_PATH to find its own libraries. I
 believe it will probably reset (erase) the contents of LD_LIBRARY_PATH
 once the O.S. processes (window manager, etc.) are started.
 
 As I said, if your terminal emulator opened a login shell you would
 not have problems leaving the setting in .bash_profile, as it would be
 read again when you open a new shell (if you are starting your
 application through a shell). However, I believe this is not really
 very standardized. As a rule of thumb, I try to put as much as
 possible in .bashrc and leave only the source of .bashrc in
 .bash_profile, as this increases the chances of it just working.
 
 And while you say moving this to .bashrc is a workaround, I would
 say that using LD_LIBRARY_PATH is a workaround, or at least a kludge,
 since software that is properly installed would never need it... The
 interaction of different software packages that need to use it will
 always cause this kind of issues, and there is usually nothing much
 short of other workarounds or kludges that can be done about it...
 
 Filipe
 ___
 CentOS mailing list
 CentOS@centos.org
 http://lists.centos.org/mailman/listinfo/centos
 
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Cannot get LD_LIBRARY_PATH to work under NX (freenx)

2009-06-08 Thread Filipe Brandenburger
Hi,

On Mon, Jun 8, 2009 at 16:42, Gary Greeneggre...@minervanetworks.com wrote:
 I'm surprised that since it installs in a non-standard location that it 
 doesn't create a /etc/ld.so.conf.d/ conf file. In that case it's a simple 
 drop-in file that only requires ldconfig to be run after the package 
 installation

I believe some of the libraries clash with ones provided by the O.S.,
and should be used by NX binaries only, so adding to ldconfig is not
the proper solution there...

From what I see, the NX binaries are actually linked to the NX
libraries using the full path, or using RPATH when not specifying the
whole path, so I'm not sure why they use LD_LIBRARY_PATH... However,
using strings and grep I can see that they do use it and
apparently reset it. They might be resetting it as a measure of
security.

Filipe
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Cannot get LD_LIBRARY_PATH to work under NX (freenx)

2009-06-08 Thread Les Mikesell
Filipe Brandenburger wrote:
 Hi,
 
 On Mon, Jun 8, 2009 at 16:42, Gary Greeneggre...@minervanetworks.com wrote:
 I'm surprised that since it installs in a non-standard location that it 
 doesn't create a /etc/ld.so.conf.d/ conf file. In that case it's a simple 
 drop-in file that only requires ldconfig to be run after the package 
 installation
 
 I believe some of the libraries clash with ones provided by the O.S.,
 and should be used by NX binaries only, so adding to ldconfig is not
 the proper solution there...
 
From what I see, the NX binaries are actually linked to the NX
 libraries using the full path, or using RPATH when not specifying the
 whole path, so I'm not sure why they use LD_LIBRARY_PATH... However,
 using strings and grep I can see that they do use it and
 apparently reset it. They might be resetting it as a measure of
 security.

But wouldn't it be more polite to reset it back to what it had picked up 
from your .bash_profile if you had some reason to change it there?

-- 
   Les Mikesell
lesmikes...@gmail.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos