> From [EMAIL PROTECTED] Mon Oct  9 06:53:07 2000
> Date: Mon, 9 Oct 2000 15:00:06 +0200
> To: [EMAIL PROTECTED]
> From: Peter Breuer <[EMAIL PROTECTED]>
> Subject: LPRng: setting environment for accounting script
>
> Hello there,
>
> I'm running an acconting script written in Python via the ifhp-filter option:
>
> accounting=/usr/local/libexec/filters/accounting_script.py
>
> Python needs some Environment-Variables to work correct.
> (LD_LIBRARY_PATH and PYTHONPATH).
> I was able to set LD_LIBRARY_PATH to what I wanted modifying /etc/lpd.conf
> and therein filter_ld_path correctly.
> But it seems as if there is no possibility to set a completely new
> environment-variable
> here. I used to fix similar problems with the apache server modifying
> httpd.conf
> and using the setenv directive.
> Is there a possibility to set new environment variables for the
> environment, the
> filters of LPRng are running in?
>
> Thanks for any tip
>
> Peter
>
> ---------------------------------------------------------------------
> Peter Breuer, http://www.psych.uni-goettingen.de/home/breuer
> Georg-Elias-Mueller-Inst. f. Psychologie, Gosslerstr. 14, 37073 Goettingen,
> Germany
> Tel: (+49)551-39-3588,  Fax: (+49)551-39-3662

Ummm....  I hate to say this,  but the short answer is no.

The problem here is that there are alternatives to adding this functionality,
namely a shell script wrapper.

#!/bin/sh
PYTHONPATH=/....
LD_LIBRARY_PATH=/....
exec /what_you_want xxx "$@"

If you don't like shell scripts, may I recommend:

#include <stdlib.h>
int main( int argc, char **argv ){
        setenv("PYTHONPATH","/...")
        setenv("LD_LIBRARY_PATH","/...")
        execv("/bin/python", argv );
        return(0);
}

Sorry about that...

Patrick

Patrick Powell                 Astart Technologies,
[EMAIL PROTECTED]            9475 Chesapeake Drive, Suite D,
Network and System             San Diego, CA 92123
  Consulting                   858-874-6543 FAX 858-279-8424 
LPRng - Print Spooler (http://www.astart.com)

-----------------------------------------------------------------------------
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to