an attempt at documentation of my ongoing struggles with solaris and opensolaris on x86. I believe strongly in the (public) documentation of trials, struggles and failures, even more so than in the documentation of success: With a long standing commitment to solaris, looking for answers and just finding "I tried it on distibution 'X' and it worked for me" is not very informative.

Thursday, February 19, 2009

ending LD_LIBRARY_PATH woes

As I have the habit of installing most of the hand built tools into /usr/local, I quite frequently run into troubles when secific apps require additions to the library path.

The rationale being that /usr/local seems to be somewhat of a default, and with various software repositories for solaris such as blastwave, sunfreeware etc have a tendency to install somewhere in /opt, This keeps at least some sanity to my filesystems.

As any lazy bastard, I normally would fix this by temporarily setting LD_LIBRARY_PATH to include the correct path and fire up the application.

Solaris and opensolaris have had a clean alternative to that a long time: via crle...

Here's how to add /usr/local/lib to it:
# crle

Default configuration file (/var/ld/ld.config) not found
Platform: 32-bit LSB 80386
Default Library Path (ELF): /lib:/usr/lib (system default)
Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default)
# crle -u -l /usr/local/lib
# crle

Configuration file [version 4]: /var/ld/ld.config
Platform: 32-bit LSB 80386
Default Library Path (ELF): /lib:/usr/lib:/usr/local/lib
Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default)

Command line:
crle -c /var/ld/ld.config -l /lib:/usr/lib:/usr/local/lib

#
Note: when the config file exists, the single "-l" will overwrite the previous entries, however in the "special" case of a nonexistent /var/ld/ld.config, it will add the directory after the -l path.

No comments: