Re: I have a weird issue with a script running under cron

Bruce Johnson <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <[email protected]>
On Feb 18, 2014, at 4:02 AM, Peter J. Holzer <[email protected]> wrote:

> On 2014-02-17 22:43:58 +0000, Bruce Johnson wrote:
>> On Feb 17, 2014, at 2:48 PM, John D Groenveld <[email protected]> wrote:
>>> The OP shouldn't need to set a LD_LIBRARY_PATH so long as
>>> he built DBD::Oracle with the correct runtime link path, but
>>> a simple shell script to see which libraries aren't resolving
>>> would be a useful test:
>>> #!/bin/ksh
>>> /bin/env - /usr/bin/ldd /usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so
>> 
>> Everything works on the command line interactively. The error only
>> happens when the script is run via cron;
> 
> Yes, so obviously you should run John's little script via cron, too.
> What is the result?

interactively:

ldd /usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so
	linux-vdso.so.1 =>  (0x00007fffc2dd4000)
	libocci.so.11.1 => /usr/lib/oracle/11.2/client64/lib/libocci.so.11.1 (0x00007fe71e965000)
	libclntsh.so.11.1 => /usr/lib/oracle/11.2/client64/lib/libclntsh.so.11.1 (0x00007fe71c0d3000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fe71beab000)
	libc.so.6 => /lib64/libc.so.6 (0x00007fe71bb18000)
	libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fe71b811000)
	libm.so.6 => /lib64/libm.so.6 (0x00007fe71b58d000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fe71b377000)
	libnnz11.so => /usr/lib/oracle/11.2/client64/lib/libnnz11.so (0x00007fe71afaa000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007fe71ada6000)
	libnsl.so.1 => /lib64/libnsl.so.1 (0x00007fe71ab8d000)
	libaio.so.1 => /lib64/libaio.so.1 (0x00007fe71a98b000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fe71edfd000)


Via cron (with the Oracle environment variables set as in the script in question, please read the OP!):

SHELL=/bin/sh
USER=root
LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib
ORACLE_SID=PHMWEB
PATH=/usr/bin:/bin
PWD=/root
HOME=/root
SHLVL=2
LOGNAME=root
ORACLE_HOME=/usr/lib/oracle/11.2/client64


	linux-vdso.so.1 =>  (0x00007fff33dff000)
	libocci.so.11.1 => /usr/lib/oracle/11.2/client64/lib/libocci.so.11.1 (0x
00007ff92b1e0000)
	libclntsh.so.11.1 => /usr/lib/oracle/11.2/client64/lib/libclntsh.so.11.1
 (0x00007ff92894e000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ff928726000)
	libc.so.6 => /lib64/libc.so.6 (0x00007ff928393000)
	libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007ff92808c000)
	libm.so.6 => /lib64/libm.so.6 (0x00007ff927e08000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007ff927bf2000)
	libnnz11.so => /usr/lib/oracle/11.2/client64/lib/libnnz11.so (0x00007ff9
27825000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007ff927621000)
	libnsl.so.1 => /lib64/libnsl.so.1 (0x00007ff927408000)
	libaio.so.1 => /lib64/libaio.so.1 (0x00007ff927206000)
	/lib64/ld-linux-x86-64.so.2 (0x00007ff92b678000)


No difference.



-- 
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group

Institutions do not have opinions, merely customs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.