ppr-list-digest volume 3, number 45, message 2

Note: please don't spam any of the e-mail addresses which you see here. Follow this link if you want some addresses to misuse.


From: David Chappell <David.Chappell@mail.trincoll.edu>
Date: Tue, 27 Mar 2001 12:23:27 -0500
Subject: Re: Antwort: Re: Antwort: Re: Antwort: Re: PPR: Receiving mail from PPR

Alain.Lachapelle@Heimannsystems.Com wrote:

> Hi,
> 
>>> #! /bin/sh
>>> echo TEST TEST TEST TEST &&
>>> sendhmp -s "38 3 99 9 0xF200 4: 3 6 0 0"[
>> 
>> I don't really understand your program.  I just tried this:
> 
>> #! /bin/sh
>> echo "hello"
> 
>> and I got "hello" in /var/spool/ppr/logs/pprd, which is what one would
>> expect.
> 
> 
> It's only a message-sending utility tant can send messages to our
> processes. Using this script, ppr can communicate with any active process
> of the system.
> 
> When this script is ran from the command prompt in the
> /usr/lib/ppr/responders directory it runs all right.  But when called from
> pprd (as I've looked into the /var/spool/ppr/logs/pprd file) it cannot find
> shared libraries needed for its execution (i.e. the error is logged in the
> pprd file, along with the output of the echo command).  It looks like there
> is a shell environment difference between executing this script manually
> from the /usr/lib/ppr/responders directory and having it executed as a
> responder by pprd when the outcome of a print job is known.
> 
> Regards,
> 
> Alain
> 
This is a classic problem.  Let me guess, you are setting 
LD_LIBRARY_PATH in /etc/profile or something like that.  The problem is 
that when you run the responder from the shell prompt it inherits the 
environment variable settings of the shell.  In contrast, when it is run 
from pprd (which is a child of init and not of your shell), 
LD_LIBRARY_PATH is unset or is set to something else.

In Solaris, the only way I know of to solve this is to edit one of the 
main startup scripts so that LD_LIBRARY_PATH is set before the daemons 
are launched.  On Linux the solution is much easier:  stop using 
LD_LIBRARY_PATH and use /etc/ld.so.conf instead.  Remember to run 
/sbin/ldconfig.

If you don't want make so far reaching a change right now, just set 
LD_LIBRARY_PATH at the top of your responder script and export it.

Be ware of one thing.  If you stop pprd and restart it from your shell 
prompt, this problem will "go away" but will come back after the next 
reboot.  Explaining this effect is left as an excercise for the reader.  :-)