Roman said:
Thanks for help. But it is not exactly solution I am looking for. I
would like to do it from python script. For example
update_env() #<- this function will change LD_LIBRARY_PATH
import extension_that_depends_on_shared_library
Roman
I think I should have permissions to do it. (more over users of my
scripts should have permissions )
Yep. Unfortunatly if you don't have access to the /etc/ld.so.conf file,
the only option left is your wrapper script idea. (By the way, have you
actually tested to see if setting the LD_LIBRARY_PATH actually works? If
not, you're really up the creek.)
If the script is in shell, you could use something like:
(Dotted lines denote start and end of script, not actual script content)
-----------------------------------------------------------
#!/bin/sh
if ! echo ${LD_LIBRARY_PATH} | /bin/fgrep -q "/path/to/your/library" then
export LD_LIBRARY_PATH=$oldpath":/path/to/your/library"
fi
<wrapped program> $*
-----------------------------------------------------------
This will check to see if your library path is in the LD_LIBRARY_PATH,
set it if it's not, and then run your wrapped program, passing it the
arguments that the wrapper script was called by.
Joal