Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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)?

share|improve this question

2 Answers 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.

share|improve this answer
    
Something like the third block from Setting Oracle Environment Variables and the last comment-- since nxserver has its own home directory? –  xtian Oct 9 '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 9 '13 at 20:53
up vote 1 down vote accepted

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)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.