Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libclntsh.so.11.1: cannot open shared object file.

Tags:

I want to schedule a task on Linux by icrontab, and the task is written in python and have to import cx_Oracle module, so I export ORACLE_HOME and LD_LIBRARY_PATH in .bash_profile, but it raise the error:

libclntsh.so.11.1: cannot open shared object file.

Since it is ok to run the task by issue the command in shell like:

python a.py  # ok 

I change the task in icrontab into a shell script which invoke my Python script, but the exception recurred?

# the shell script scheduled in icrontab #! bash  python a.py     

Could you help how to do with it?

like image 758
e.b.white Avatar asked Apr 25 '10 13:04

e.b.white


2 Answers

Possibly you want to specify PATH — and also ORACLE_HOME and LD_LIBRARY_PATH — so that cron(1) knows where to find binaries.
Read "5 Crontab environment" here.

like image 77
YasirA Avatar answered Sep 29 '22 10:09

YasirA


The libs are located in /u01/app/oracle/product/11.2.0/xe/lib (For Oracle XE) or similar.

You should add this path to /etc/ld.so.conf or if this file shows only an include location, as in a separate file in the /etc/ld.so.conf.d directory

I have oracle.conf in /etc/ld.so.conf.d, just one file with the path. Nothing else.

Of course don't forget to run ldconfig as a last step.

like image 23
Dimitri Avatar answered Sep 29 '22 11:09

Dimitri