473,395 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

DBD::DB2 not finding .so file on system startup

I have a Perl script using DBD::DB2, that runs during system startup on
a Solaris system. The script is working fine during startup on many
machines, except on one machine it fails complaining about a missing
".so" file, with Perl flagging the "use DBD::DB2" line. (I don't have
the exact message since I'm heard about it from a remote sysadmin who
only saw it scroll by on the console). However, if I login as root on
that machine and run the Perl script, it works fine.

I'm thinking there must be some difference in the environment present
at system startup, versus at an interactive shell, which is causing it
to find the .so file when run interactively, but not during startup.
Perhaps it's related to the LD_LIBRARY_PATH variable? I noticed that
the LD_LIBRARY_PATH *is* set for my interactive root shell, but I'm
not sure what it's set to (if anything) during system startup. Perhaps
there a way to re-install DBD::DB2 to fix this?

Jan 5 '06 #1
4 2407
Generally, this would be either not finding the shared library (so) or
not having rights to it. You should try to find out the exact error
message, and then figure out the nature of the error.

B.

Jan 5 '06 #2
Larry wrote:
I have a Perl script using DBD::DB2, that runs during system startup on
a Solaris system. The script is working fine during startup on many
machines, except on one machine it fails complaining about a missing
".so" file, with Perl flagging the "use DBD::DB2" line. (I don't have
the exact message since I'm heard about it from a remote sysadmin who
only saw it scroll by on the console). However, if I login as root on
that machine and run the Perl script, it works fine.

I'm thinking there must be some difference in the environment present
at system startup, versus at an interactive shell, which is causing it
to find the .so file when run interactively, but not during startup.
Perhaps it's related to the LD_LIBRARY_PATH variable? I noticed that
the LD_LIBRARY_PATH *is* set for my interactive root shell, but I'm
not sure what it's set to (if anything) during system startup. Perhaps
there a way to re-install DBD::DB2 to fix this?


DBD::DB2 doesn't load libdb2.so via the LD_LIBRARY_PATH, but by having the
path hardcoded in its own RPATH. So the first thing to come to mind is
that you have DB2 installed on an NFS drive or some other remote partition
that hasn't been mounted yet.

If DB2 is on a locally-mounted partition, then reinstalling the module may
actually help.

Jan 5 '06 #3

Darin McBride wrote:
Larry wrote:
I have a Perl script using DBD::DB2, that runs during system startup on
a Solaris system. The script is working fine during startup on many
machines, except on one machine it fails complaining about a missing
".so" file, with Perl flagging the "use DBD::DB2" line.
DBD::DB2 doesn't load libdb2.so via the LD_LIBRARY_PATH, but by having the
path hardcoded in its own RPATH. So the first thing to come to mind is
that you have DB2 installed on an NFS drive or some other remote partition
that hasn't been mounted yet.

If DB2 is on a locally-mounted partition, then reinstalling the module may
actually help.


We were able to fix it by re-installing the DBD::DB2 module. The best
theory I can come up with now is that the first it was installed, the
DB2_HOME env. var. was not defined. Although I was not the one that
worked on the system in question, I have had experience with installing
DBD::DB2 and forgetting to set DB2_HOME. IIRC, the install does not
complain, and the module will even work in most cases, but such an
installation causes the module to rely on some env. variable(s)
(LD_LIBRARY_PATH, ... ?) in order to work. This would seem to explain
the observed behavior where the module would work in scripts called
from a shell prompt, but not during startup.

What do you think of this explanation? Even though the system is
working now, the higher-ups would like to know why it hapenned
(post-mortem).

Jan 7 '06 #4
Larry wrote:
Darin McBride wrote:
Larry wrote:
> I have a Perl script using DBD::DB2, that runs during system startup on
> a Solaris system. The script is working fine during startup on many
> machines, except on one machine it fails complaining about a missing
> ".so" file, with Perl flagging the "use DBD::DB2" line.
DBD::DB2 doesn't load libdb2.so via the LD_LIBRARY_PATH, but by having
the
path hardcoded in its own RPATH. So the first thing to come to mind is
that you have DB2 installed on an NFS drive or some other remote
partition that hasn't been mounted yet.

If DB2 is on a locally-mounted partition, then reinstalling the module
may actually help.


We were able to fix it by re-installing the DBD::DB2 module. The best
theory I can come up with now is that the first it was installed, the
DB2_HOME env. var. was not defined. Although I was not the one that
worked on the system in question, I have had experience with installing
DBD::DB2 and forgetting to set DB2_HOME. IIRC, the install does not
complain, and the module will even work in most cases, but such an


Actually, as I recall it, unless there's a newer version that "fixes" this,
the module won't install without the DB2_HOME variable set during the "perl
Makefile.PL" phase. In fact, the "perl Makefile.PL" phase won't complete
without this variable set. This makes it kind of annoying to try to get it
to automatically install as part of a CPAN shell.
installation causes the module to rely on some env. variable(s)
(LD_LIBRARY_PATH, ... ?) in order to work. This would seem to explain
the observed behavior where the module would work in scripts called
from a shell prompt, but not during startup.

What do you think of this explanation? Even though the system is
working now, the higher-ups would like to know why it hapenned
(post-mortem).


My guess is that you've upgraded DB2 at some point. You installed DBD::DB2
by compiling against version X, but since then, you've migrated to version
Y, and then uninstalled version X. So DBD::DB2 is still looking for
libdb2.* in version X's directory, but obviously failing. The system
library loader then falls back to looking in your LD_LIBRARY_PATH (or
LIBPATH on AIX or SHLIB_PATH on HP), and has been finding it that way.
Because of DB2's backward-compatability, the new version of libdb2.* works
fine with applications, such as DBD::DB2, which are compiled against the
older version of libdb2.*, so everything seems fine.

This is just a guess, of course, as I have no idea if this machine is old
enough to have had an older version of DB2 on it at some point that you may
have started using DBD::DB2 with.

Jan 8 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bing Wu | last post by:
(copied to comp.databases.ibm-db2) Greetings, Settings: DBD::DB2 v0.76 DBI v1.38 Perl v5.8.0 IBM DB2 ESE v8.1 sp 4
0
by: Hemant Shah | last post by:
Folks, I have DB2 UDB 7.2 EE installed on AIX 5.2 system. I think I am at latest fixpack, see output of lslpp below. I have also installed DB2 UDB 7.2 EE on RedHat Linux 7.3 I believe that is...
0
by: Philip Nelson | last post by:
Noticed today that there have been two new versions of the DB2 driver released over the last week.   This is the first time IBM has released an update since October 2001, so to give us...
1
by: Larry | last post by:
I'm having problems getting any CLI trace info from my Perl script (which uses DBI and DBD::DB2). I did: db2 update cli cfg for section common using trace 1 db2 update cli cfg for section...
2
by: bastb | last post by:
Hi, We've been using the perl DBD::DB2 driver on Perl version 5.8.0 (aix_thread_multi) for a project we're working on without any problems until now. We've been using DBD::DB2 version 0.78 on...
0
by: Hemant Shah | last post by:
Folks, Here is my setup: DB2 V8.2 ESE running on Linux with utf-8 code set. Database territory = us Database code page ...
2
by: Evie | last post by:
I'm attempting to connect to a DB2 database using perl DBD::DB2. I'm consistently getting the following error: SQL1042C An unexpected system error occurred. SQLSTATE=58004 What I have...
1
by: lucybridges | last post by:
Can anyone shed some light on what is causing this, please? Using Perl 5.8.5 (64 bit) on RH enterprise Linux AS release 4 (2.6.9-22.ELsmp) I'm receiving the following error: DBI...
3
by: roxrox_1959 | last post by:
I'm attempting to connect to a DB2 database using DBD::DB2 running on a Linux device. I'm getting the following error: ** connect: Unable to get database handle: DBI...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.