0

The FreeNX server gives the following error on startup:
APPLICATION_LIBRARY_PRELOAD [...] /usr/lib/libX11.so could not be found.

The thing is that /usr/lib/libX11.so library is already installed, except on my system it's in the directory /usr/lib/NX/lib.
How do I point NX to the right directory?

There is no APPLICATION_LIBRARY_PRELOAD in /etc/nxserver/node.conf. How can I fix this directory problem and not mess up SELinux contexts (thinking to just add links everywhere NX is looking)?

xtian
  • 321
  • 3
  • 15

2 Answers2

2

Based on the description in your question your problem isn't that the library isn't installed, it's that ld (the dynamic linker) doesn't know where it is: CentOS expects the library to be in /usr/lib/ but it's really in /usr/lib/NX/lib.

There are a few ways to fix this:

  1. Set the LD_LIBRARY_PATH environment variable to include your non-standard library paths before starting the NX server.

  2. Create symlinks from the /usr/lib/NX/lib/* libraries to /usr/lib

  3. (The "Right Way") Tell ld about your non-standard library paths so it searches them.


Options 1 and 2 should be pretty self-explanatory.
For more information on Option 3, check out this answer on a similar question.

voretaq7
  • 79,345
  • 17
  • 128
  • 213
  • Something like the _third block_ from [Setting Oracle Environment Variables](https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Tuning_and_Optimizing_Red_Hat_Enterprise_Linux_for_Oracle_9i_and_10g_Databases/sect-Oracle_9i_and_10g_Tuning_Guide-Setting_Up_a_Working_Environment_for_Oracle-Setting_Oracle_Environment_Variables.html) and the _last comment_-- since nxserver has its own home directory? – xtian Oct 09 '13 at 20:45
  • @xtian Yes, provided you always `su` to the NX user before starting the server, but I would *really* suggest option 3 rather than option 1. It's a more proper solution, and works no matter what user NX is launched as. – voretaq7 Oct 09 '13 at 20:53
1

I'm answering my own question only because I happened to find a 4th solution--a needle in the haystack. I did some ldd testing on /usr/bin/nx*, which strangely didn't return the information matching my dynamic libraries that I was expecting. grep on the same files just happened to find this block in /usr/bin/nxloadconfig:

#########################################################################
# INTERNAL STUFF
# DO NOT TOUCH unless you REALLY know what you are doing
#########################################################################

NX_VERSION=3.2.0-74-SVN
NX_LICENSE="OS (GPL, using backend: %BACKEND%)"

# Where can different nx components be found
NX_DIR=/usr
PATH_BIN=$NX_DIR/bin # if you change that, be sure to also change the public keys
PATH_LIB=$NX_DIR/lib
NX_ETC_DIR=/etc/nxserver
NX_SESS_DIR=/var/lib/nxserver/db
NX_HOME_DIR=/var/lib/nxserver/home

# Advanced users ONLY
AGENT_LIBRARY_PATH="" #Calculated
PROXY_LIBRARY_PATH="" #Calculated
APPLICATION_LIBRARY_PATH="" #Calculated
APPLICATION_LIBRARY_PRELOAD="" #Calculated

# the name of the authorized keys file for ssh
SSH_AUTHORIZED_KEYS="authorized_keys2"

I manually edited PATH_LIB=$NX_DIR/lib to PATH_LIB=$NX_DIR/lib/NX/lib and now the only missing files are actually missing (libXcomp.so.2)

xtian
  • 321
  • 3
  • 15