in reply to Re: possible perl5.8.7 bug?
in thread possible perl5.8.7 bug?

My apologies for taking the shortcut of looking only for a shared experience here (as clue) rather than a solution. The complexity of the problem etc!

(runme.sh): exec perl5.8.7 cronmgr.pl # always succeeds for 5.8.0

(cronmgr.pl): use Carp; print "ok done\n";

#non-cron> runme.sh # ==> "ok done"

#cronuser> runme.sh # ==> "ok done"

(cronmgr.pl): use BerkeleyDB; print "ok done\n";

#non-cron> runme.sh # ==> "ok done"

#cronuser> runme.sh # ==> FAIL

Let $bdbpath = `find / -name BerkeleyDB` # result(s)

(cronmgr.pl): use lib $bdbpath; use BerkeleyDB; print "ok done\n";

#non-cron> runme.sh # ==> "ok done"

#cronuser> runme.sh # ==> FAIL

The actual wrapper code in cronmgr.pl uses eval and logs custom messages from the results (but no captured meta output). The primary suspect is the cron environment, of course. But one would expect a targetted "use lib" to counter that surely? I have yet to try if Carp will be more informative. I will also try rolling out a newer cron, as suggested, seeing there are no similar experiences out there!

cheers Pstack

Replies are listed 'Best First'.
Re^3: possible perl5.8.7 bug?
by Corion (Patriarch) on Jan 03, 2006 at 22:58 UTC

    You seem to rely on perl5.8.7 to be found via $ENV{PATH} - I would want to eliminate any such reliance by using an explicit exec /opt/perl/bin/perl5.8.7, so that both users will always invoke exactly the same Perl binary. As BerkeleyDB uses a binary component, that component must be tailored to the perl5.8.7 you use. If for example one Perl was compiled with threads and the other wasn't, that might lead to the problems.

    Also, could you elaborate on how the runme.sh "fails" ? Is there any error output given?

      Unfortunately runme.sh has to have this form for cron:

      exec perl5.8.7 cronmgr.pl < /dev/null >&0 2>&0

      and, of course, I cannot even pass back a useful exit value from cronmgr.pl because it is always seen as null (as long as the 5.8.7 interpreter itself fires ok, which it does!). And leaving out the chaining effect of exec, other subsequent commands in runme.sh will execute ok too.

      But food for thought on the config issues after a cron upgrade, if that doesn't help.

      cheers

      Pstack

      My apologies. I did reply, but it may have been pulled due to non-formatting or poor-formatting! Cheers. Pstack