Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I've compiled Perl script and now I'm using it in this environment :
MAILTO=xxx@xxx.xxx.xxx # Activity reports every 5 minutes everyday&>> */5 * * * * www-data USER=www-data;PAR_CLEAN=1;/usr/local/bin/Convert +_All_CybroItems.sh 1>>/var/log/Tinia/Convert_All_CybroItems-error.log + 2>>/var/log/Tinia/Convert_All_CybroItems-error.log


and I have in /usr/local/bin/Convert_All_CybroItems.sh :

#!/bin/bash /usr/bin/tail -n 5000 /var/log/Tinia/Tinia_Visu/All_CybroItems_log.txt + > /var/log/Tinia/All_CybroItems_log_latest.txt /bin/cat /var/log/Tinia/All_CybroItems_log_latest.txt | /usr/local/bin +/All_CybroItems_log_to_xml > /var/www/tinialine/all_cybro_items.xml +2>>/var/log/Tinia/Convert_All_CybroItems-error.log
where "/usr/local/bin/All_CybroItems_log_to_xml" is compiled Perl script with pp.

"All_CybroItems_log_latest.txt" has valid content, but I get this error in "Convert_All_CybroItems-error.log":

/usr/local/bin/All_CybroItems_log_to_xml: creation of /tmp/par-SYSTEM/cache-a7209413b5765281c83780bce66a67ab297f38c1/libperl.so.5.8 failed - aborting with 2.

The problem seems related to fact that I also have other compiled scripts running on system under root. Therefore directory /tmp/par-SYSTEM/ becomes owned by root, but I need somehow to run problem script under user www-data, so it will expand in /tmp/par-www-data/, but it seems that common libraries are always expanded in par-SYSTEM ...

Is there anyway to avoid this problem ? Any more info on running compiled scripts as various users ?

Thanks in advance,

regards,

Bulek.

Replies are listed 'Best First'.
Re: Problems with Par PP - creation of /tmp/par-SYSTEM/cache ... failed
by Anonymous Monk on Feb 08, 2010 at 02:43 UTC
    seems that common libraries are always expanded in par-SYSTEM ...

    Check the %ENV for PAR vars overrides (see PAR::Environment

    PAR should always expand in $TMP/par-username, so your user must be SYSTEM, or there is an override

      Hi,

      thanks for response. I'm afraid I cannot understand fully your advice. Is there a solution to this problem and what should I do (i've tried to change environment variables - but it seems that common libraries are always expanded in par-SYSTEM) ?

      Thanks in advance,

      regards,

      Bulek.

        • check env export |grep PAR
        • check username print $ENV{USERNAME}
        • export PAR_GLOBAL_DEBUG=666
        • some combination of chown/chmod so user not root owns executable
        • ...
        • document your debugging efforts