procmail
[Top] [All Lists]

Re: Shared Lib problem

2001-03-07 15:13:42
James Thompson <jamest(_at_)math(_dot_)ksu(_dot_)edu> writes:
...
It works fine from the command line but fails in my .procmailrc due to it
not being able to load the database's shared library.
...
ImportError: ld.so.1: python: fatal: libpq.so: open failed: No such file
or directory
...
Which implies my environment is not correct.  However I'm not sure where
else I can set LD_LIBRARY_PATH to compensate for this.  The lib is
available from my normal login acocunt.  I've also created a .profile with
it in there (under my account).  I've also added it to roots
LD_LIBRARY_PATH.  Also attempted to add it to top of my .procmailrc.  
None of these have solved my problem.

Any ideas on what I'm doing wrong?

Your first error is using LD_LIBRARY_PATH.  LD_L_P is _evil_ and should be
avoided at all cost.  What makes it evil is that programs and libraries
that were linked while LD_L_P was set effectively require it to _always_
be set.  The library location information should either be store in a
system config file (ala /etc/ld.so.conf & /etc/ld.so.cache) or in the
executable or library itself (via the -R or -rpath option to the linker).
I don't know the mechanics of python's import system, but _surely_ you
can either link the python extension against libpq such that the path or
libpq is in the extension, or there's a way to pass a list of directories
to the import system that it should look in _without_ using LD_L_P.

Having been there myself, I can tell you that you will rue the day you
ever set LD_L_P in your login environment.  Unset it now and fix the
problems now or you will be dealing with them forever.  If you aren't in
control of the python setup and therefore can't fix it, complain to your
sysadmin loadly and repeatedly.  There are ways to ease to transition
from LD_L_P to sanity, but they are platform specific and you didn't
tell us what OS you're using.


If you think the above rant is utter nonsense and insist on continuing
to use LD_L_P, or you sysadmin is unwilling to fix it, then set LD_L_P
at the top of your .procmailrc, and may whatever deity you believe in
have mercy on you.


Philip Guenther

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>