Problem with LD_LIBRARY_PATH

I am on Solaris .

I have written a script callled T_1.sh

#!/bin/sh







########################################################################################################
# # Source borne shell env.This is required for crontab to work as bip.sh  uses environmental variables.
########################################################################################################
. /.ss.sh






#######################################################################
# ORACLE/ARBOR ENVIRONMENT VARIABLE DECLARATION
#######################################################################
ORACLE_HOME=/var/opt/oracle/product/10g; export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:/bin:/usr/bin; export PATH
ARBOR_USR=$ARBORDBU; export ARBORDBU
ARBOR_DB_PASSWD=`cat $ARBORDIR/.arborpw`; export ARBOR_DB_PASSWD
ORACLE_SID=$DSQUERY; export ORACLE_SID





#######################################################################
####MAIN SCRIPT
#######################################################################
today=`date "+%m-%d-%Y  %H:%M:%S"`; export today
CUR_DIR=/arbor/prdqa_ac/scripts ; export CUR_DIR
SCRIPT_DIR=/arbor/integ_fx/scripts
LOG_FILE=$CUR_DIR/error.log; export LOG_FILE

# Direct script output to log


echo "SQLPLUS CONNECTION"

sqlplus -s $ARBOR_USR/$ARBOR_DB_PASSWD@$ORACLE_SID<<EOF>$CUR_DIR/sql_output.txt
set feedback off
set heading off
select distinct account_no from adj  WHERE ADJ_TRANS_CODE=-2401  and request_status=1  and bill_ref_no=0
order by account_no;
EOF






if [  ! -s  "$CUR_DIR/sql_output.txt" ]
then
echo "No account number for bad debt"
else
for i in `cat $CUR_DIR/sql_output.txt`
do
echo "bip $i is running"
sh  $SCRIPT_DIR/bip.sh 01 0 $i >  $CUR_DIR/bip_log_1.txt
sleep 200
done
fi


###Removing temporary log files generated

if [ -f  "$CUR_DIR/bip_log_1.txt" ]
then
 rm  "$CUR_DIR/bip_log_1.txt"
 echo "file bip__log_1.txt removed"
fi

if [ -f "$CUR_DIR/sql_output.txt" ]
then
 rm  "$CUR_DIR/sql_output.txt"
 echo "sql_output.txt removed"
fi

rm  $CUR_DIR/error.log

I am calling bip.sh(it is standardises script.bip.sh further calls a binary file called BIP in its procedure).When i m running the T_1.sh it throws an error

ld.so.1: BIP: fatal: librc.so: open failed: No such file or directory

Cause of this error is

This occurs if the environment variable LD_LIBRARY_PATH (Sun), is not set correctly. The value should be $COBDIR/lib:$LD_LIBRARY_PATH\ 
(or the appropriate variant) on Server Express $COBDIR/coblib:$LD_LIBRARY_PATH (or the appropriate variant) on Object COBOL Developer Suite.

Please provide me the solution.I am able to run this code in DEV environment but it is failing in QA environment

---------- Post updated at 12:41 PM ---------- Previous update was at 11:11 AM ----------

Anyone?

Did you check the LB_LIBRARY_PATH in the QA env?
Is the lib librc.so present in the standard library paths?

I am assuming the script bip.sh is calling the binary BIP?

--ahamed

1 Like

Hi Ahmed,

Yes bip.sh is calling the BIP .I cant see anything like librc.so in LD_LIBRARY_PATH .
When i run the bip.sh from the command line it works fine :confused:

Why dont you export the LD_LIBRARY path within the bip.sh and try?
It is not a secure solution though. If you are on solaris, check ldconfig is available.

--ahamed

I did export but same error.I am on SOLARIS
u mean like this

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

yeah something like that

--ahamed

When i included the LD export i get an error

./BIP_BAD_DEBT_REVERSAL.sh: LD_LIBRARY_PATH=/arbor/prdqa_ac/site_specific/apits/javaclient/lib32:/app/tuxedo/tuxedo9.0_32/tuxedo9.0/
lib:/app/weblogic/bea-acprdqa/patch_weblogic910/profiles/default/native:/app/weblogic/bea-acprdqa/weblogic91/server/native/solaris/sparc:/app/weblogic/
bea-acprdqa/weblogic91/server/native/solaris/sparc/oci920_8:/var/opt/oracle/product/10g/lib:/arbor/3p/rosette/lib:/arbor/3p/ACE_wrappers/bin:/arbor/3p/python/
lib:/arbor/3p/perl/lib:/arbor/3p/xerces/lib:/arbor/3p/xalan/lib:/app/tuxedo/tuxedo9.0/lib:/arbor/prdqa_ac/configurator_fx_site/lib:/arbor/prdqa_ac/ordering_site/
lib:/arbor/prdqa_ac/bsdm_site/lib:/arbor/prdqa_ac/site_specific/lib:/arbor/prdqa_ac/arm_site/lib:/usr/java/jre/lib/sparcv9/server:/usr/java/jre/lib/sparcv9/server/..:
/lib:/arbor/3p/pgsql/lib:/arbor/prdqa_ac/opcntr/agent/libs:/arbor/prdqa_ac/opcntr/tools/apache/modules:/arbor/prdqa_ac/opcntr/cc/libs:/arbor/3p/apache/
lib:/arbor/3p/openssl/lib:/arbor/prdqa_ac/DataBlitz/lib:/lib:/usr/lib:/lib:/var/opt/oracle/product/10g/lib:/usr/cobol/lib:/arbor/prdqa_ac/workflow_site/lib:/arbor/prdqa_ac/
workpoint_site/lib:/arbor/prdqa_ac/inventory_site/
lib:/arbor/3p/quantum/v3.2/lib:/usr/local/
lib: is not an identifier

---------- Post updated at 05:55 PM ---------- Previous update was at 03:13 PM ----------

Any solution to fix the above issue?

What has the dev box more than this one?
What part of server-express are you running or is it running?
What is the current value of your LD_LIBRARY_PATH ?

Hi,
Are you sure that you set LD_LIBRARY_PATH to one and only one line ?
Regards.

Hi vbe,

Dev-box LD_LIBRARY_PATH HAS MORE CONTENT.(I MESSAGED YOU THE content).
I am not aware of the server-express.How can i check it and what is it?
Current value of LD_LIBRARY_PATH (in QA) i have mentioned in my earlie post.Can you please see.
Can you tell what is exactly LD_LIBRARY_PATH .

My script in QA is also not able to take parameters at runtime while it takes it in DEV(thats not a big issue though).

---------- Post updated at 12:43 PM ---------- Previous update was at 12:42 PM ----------

Yes i set it in one line

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

It is through my mistake (accidentally closing your thread when I meant to subscribe to it) that you resorted to messaging vbe. For everyone's benefit you should post the contents of that message here. Thanks, and sorry about that :slight_smile:

May I also suggest that instead of setting the Oracle environment yourself, you use the oraenv command. It also has something to add to LD_LIBRARY_PATH.

ORAENV_ASK=NO
ORACLE_SID=my_db_sid
. oraenv

Hi Scott,

My Dev environment LD_LIBRARY_PATH
This has nothing to do with oracle environment as i am able to connect to Oracle database.

/arbor/integ_fx/bsdm_site/site_specific/apits/javaclient/lib32:
/app/tuxedo/tuxedo9.0/lib:/app/weblogic/bea-integfx/patch_weblogic910/profiles/default/native:
/arbor/integ_fx/bsdm_site/site_specific/apits/javaclient/lib32
:/app/tuxedo/tuxedo9.0/lib:/app/weblogic/bea-integfx/patch_weblogic910/profiles/default/native:
/app/weblogic/bea-integfx/weblogic91/server/native/solaris/sparc
:/app/weblogic/bea-integfx/weblogic91/server/native/solaris/sparc/oci920_8:
/var/opt/oracle/product/10g/lib:/arbor/3p/rosette/lib:
/arbor/3p/ACE_wrappers/bin:/arbor/3p/python/lib:
/arbor/3p/perl/lib:/arbor/3p/xerces/lib:/arbor/3p/xalan/lib:
/app/tuxedo/tuxedo9.0/lib:/arbor/integ_fx/configurator_fx_site/lib:/arbor/integ_fx/ordering_site/lib
:/arbor/integ_fx/bsdm_site/lib:/arbor/integ_fx/site_specific/lib:/arbor/integ_fx/arm_site/lib:/usr/java
/jre/lib/sparcv9/server:/usr/java/jre/lib/sparcv9/server/..:/lib:/arbor/3p/pgsql/lib:
/arbor/integ_fx/opcntr/agent/libs:/arbor/integ_fx/opcntr/tools/apache/modules
:/arbor/integ_fx/opcntr/cc/libs:/arbor/3p/apache/lib:/arbor/3p/openssl/lib
:/arbor/integ_fx/DataBlitz/lib:/lib:/usr/lib:/lib:/var/opt/oracle/product/10g/lib:/usr/cobol/lib
:/arbor/integ_fx/workflow_site/lib:/arbor/integ_fx/workpoint_site/lib:/arbor/integ_fx/inventory_site/lib:
/arbor/3p/quantum/v3.2/lib:/var/opt/oracle/product/10g/lib:/var/opt/oracle/product/10g/lib32
:/var/opt/oracle/product/920/lib:/app/weblogic/bea-integfx/weblogic91/server/native/solaris/sparc:/app/weblogic/bea-integfx/weblogic91/server/native/solaris/sparc/oci920_8:/var/opt/oracle/product/10g/lib:/arbor/3p/rosette/lib:/arbor/3p/ACE_wrappers/bin
:/arbor/3p/python/lib:/arbor/3p/perl/lib:/arbor/3p/xerces/lib:/arbor/3p/xalan/lib
:/app/tuxedo/tuxedo9.0/lib:/arbor/integ_fx/configurator_fx_site/lib
:/arbor/integ_fx/ordering_site/lib
:/arbor/integ_fx/bsdm_site/lib:/arbor/integ_fx/site_specific/lib:/arbor/integ_fx/arm_site/lib:/usr/java/jre/lib/sparcv9/server
:/usr/java/jre/lib/sparcv9/server/..:/lib:/arbor/3p/pgsql/lib:/arbor/integ_fx/opcntr/agent/libs
:/arbor/integ_fx/opcntr/tools/apache/modules:/arbor/integ_fx/opcntr/cc/libs:/arbor/3p/apache/lib:/arbor/3p/openssl/lib
:/arbor/integ_fx/DataBlitz/lib:/lib:/usr/lib:/lib:/var/opt/oracle/product/10g/lib:/usr/cobol/lib:/arbor/integ_fx/workflow_site/lib
:/arbor/integ_fx/workpoint_site/lib:/arbor/integ_fx/inventory_site/lib:/arbor/3p/quantum/v3.2/lib:/var/opt/oracle/product/10g/lib
:/var/opt/oracle/product/10g/lib32:/var/opt/oracle/product/920/lib

Yes, the suggestion to use oraenv was not intended as a solution to your problem, only to save you from caring about the technical details about the location of your databases software.

What is the value of COBDIR, and did you add it (+ /lib) to the library path? Does that library (librc.so) exist?

Hi Scott,

value of echo $COBDIR(both in qa and dev)

/opt/microfocus/cobol

do i have to add this in LD_LIBRARY_PATH

How can i check librc.so exists or not?

Unless there is a link to that library in the library path, the original error suggests that you should.

How can i check librc.so exists or not?

/opt/microfocus/cobol is present in LD_LIBRARY_PATH in QA but not in DEV.My script is working fine in DEV though

Can you tell the exact cause of error?

/usr/cobol/lib exists in the path, but not /usr/microfocus/cobol/lib. Does the former link to the latter?

Does the file exist?:

$ find /usr -name "librc.so" 2> /dev/null

Your command did not return anything in both QA and DEV environment.

When i run bip.sh independently it works fine.So do i need to include some environmental variables in my script?

I mean is it an environment issue or a fault in my script as bip.sh works fine independently.

Still your command did not return anything in both QA and DEV environment.

That it runs fine independently, but not in a script, suggests that you forgot to export a variable, or are using an alias defined in the parent shell.

Ok.So what should i modify in my script.What variable should i export.

Scott