For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > June 2007 > Unable to run perl script within cron









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Unable to run perl script within cron
Ravi Malghan

2007-06-21, 3:59 am

Hi: I have a script which runs fine when I run it from the shell prompt. My LD_LIBRARY_PATH in the shell is as shown below

bash-2.05$ env |grep LD_LIBRARY_PATH
LD_LIBRARY_PATH=/export/home/net/oracle/instantclient_10_2:/usr/arsapi/lib:/usr/local/lib

But the same script when I run from crontab (same user as above), I get the following error in my mailbox generated by cron.

Can't load '/usr/local/lib/perl5/site_perl/5.8.7/sun4-solaris/auto/ARS/ARS.so' for module ARS: ld.so.1: perl: fatal: libicudatabmc.so.32: open failed: No such file or directory at /usr/local/lib/perl5/5.8.7/sun4-solaris/DynaLoader.pm line 230.
at /export/home/net/lookForNewRequests.pl line 10
Compilation failed in require at /export/home/net/lookForNewRequests.pl line 10.
BEGIN failed--compilation aborted at /export/home/net/lookForNewRequests.pl line 10.

I have the following lines in my script at the beginning and the file libicudatabmc.so.32 is in /usr/arsapi/lib.

$ENV{'LD_LIBRARY_PATH'} = '/export/home/net/oracle/instantclient_10_2:/usr/arsapi/lib:/usr/local/lib';

Can someone help?
Thanks
Ravi



________________________________________
________________________________________
____
Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc...monopolyherenow
Tom Phoenix

2007-06-21, 3:59 am

On 6/20/07, Ravi Malghan <rmalghan@yahoo.com> wrote:

> Hi: I have a script which runs fine when I run it from the shell prompt. My
> LD_LIBRARY_PATH in the shell is as shown below


Somebody told me that if you have to set LD_LIBRARY_PATH and you're
not testing libraries, that means that your ld needs to be configured
so that you won't have to set LD_LIBRARY_PATH. Tell your symin to
fix this.

> I have the following lines in my script at the beginning and the file
> libicudatabmc.so.32 is in /usr/arsapi/lib.
>
> $ENV{'LD_LIBRARY_PATH'} = '/export/home/net/oracle/instantclient_10_2:/usr/arsapi/lib:/usr/local/lib';


It should work if you wrap the right path setting in a BEGIN block
before the first module is 'use'd, maybe something like this:

BEGIN {
$ENV{'LD_LIBRARY_PATH'} = join ':',
'/some/very/long/path/to/my/lib' ,
'/another/of/the/same' ,
'/last/one/with/optional/trailing/comma' ,
; # end of list, end of statement
}

Good luck with it!

--Tom Phoenix
Stonehenge Perl Training
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com