[OpenIndiana-discuss] Setting LD_PRELOAD

Alan Coopersmith alan.coopersmith at oracle.com
Mon Nov 8 06:53:36 UTC 2010


Paul Johnston wrote:
> paulj at openindiana:~$ grep PRELOAD .bashrc
> LD_PRELOAD=/usr/lib/libCrun.so.1
> /usr/local/lib/erlang/erts-5.8.1.1/bin/beam.smp
> export LD_PRELOAD

That doesn't say "set LD_PRELOAD only for this program", that says
run this program RIGHT NOW (when loading your .bashrc) with that
variable set.

The conventional way when you're stuck with a binary you can't rebuild
is to mv the binary to a new name, and save a shell script in the old
name that sets the variable just for that binary and then executes it.
(Though even that has problems if your binary in turn execs other programs.)

But, since that's in /usr/local and sounds like open source software,
you should just build it right in the first place.


-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System




More information about the OpenIndiana-discuss mailing list