1753559 Members
5956 Online
108796 Solutions
New Discussion юеВ

DB starting error

 
SOLVED
Go to solution
Sutapa Dey
Frequent Advisor

DB starting error

Hi All,

I am having this peculiar problem that needs some troubleshooting
I hv installed gmake and are trying to compile some postgres code, please find the steps as below:

ln -s /opt/perl_32/lib/5.8.3/PA-RISC1.1-thread-multi/CORE/libperl.so libperl.so

cd /opt/pgsql/src
cd /opt/pgsql/src/postgresql-8.2.4

export CC=cc
export CPP="cc -E +legacy_cpp"
export LIBS="-lkrb5 -lk5crypto -lcom_err"
export LDFLAGS="-Wl,+nodefaultrpath"
./configure --prefix=/opt/iexpress/postgresql --disable-rpath --with-perl --enable-integer-datetimes --with-openssl --libdir=/opt/iexpress/postgresql/lib/hpux32 --without-readline --without-zlib --without-docdir

/usr/local/bin/gmake -f /opt/pgsql/src/postgresql-8.2.4/GNUmakefile all
/usr/local/bin/gmake -f /opt/pgsql/src/postgresql-8.2.4/GNUmakefile install

su - postgres
/opt/iexpress/postgresql/bin/createlang --echo --dbname=vsm --username=postgres plperl
$ /opt/iexpress/postgresql/bin/createlang --echo --dbname=vsm --username=postgres plperl
/usr/lib/dld.sl: Can't open shared library: ../../../src/interfaces/libpq/libpq.sl.5
/usr/lib/dld.sl: No such file or directory
Abort


Please help me with this error. I checked the user rights and also the existence of /usr/lib/dld.sl and /opt/iexpress/postgresql/src/postgresql-8.2.4/src/interfaces/libpq/libpq.sl.5. They are all fine. Please help
31 REPLIES 31
Sutapa Dey
Frequent Advisor

Re: DB starting error

The first line is not the one given above

ln -s /opt/perl_32/lib/5.8.3/PA-RISC1.1-thread-multi/CORE/libperl.sl libperl.sl
Dennis Handly
Acclaimed Contributor

Re: DB starting error

dld.sl: Can't open shared library: ../../../src/interfaces/libpq/libpq.sl.5

You don't have an absolute path to your shlib.
If you are going to use +nodefaultrpath and not +b, you might want to look to $ORIGIN for relative paths.

>export CPP="cc -E +legacy_cpp"

You can't use +legacy_cpp on PA cc.
Steven E. Protter
Exalted Contributor

Re: DB starting error

Shalom,

Check that SHLIB_PATH is properly set and that ll libraries needed are on that path variable.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sutapa Dey
Frequent Advisor

Re: DB starting error

Hi Dennis,

Thanks for the reply. I have 2 questions.

1. How can I check whether I have absolute path to SHLIB or Not? Because we have set this library path postgres .profile file

export LD_LIBRARY_PATH=/opt/pgsql/lib/:/opt/pgsql/vsm-lib:/usr/lib:/opt/pgsql/lib/hpux32
export libdir=/opt/pgsql/lib

2.If I can't use +legacy_cpp on PA cc, then how can I set the CPP value then? Any idea?

Regarding SHLIB path when I do an chatr on dld.sl I get this value

chatr /usr/lib/dld.sl
/usr/lib/dld.sl:
shared library
shared library dynamic path search:
SHLIB_PATH disabled second
embedded path disabled first Not Defined
shared vtable support disabled
explicit unloading enabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
third quadrant private data space disabled
fourth quadrant private data space disabled
third quadrant global data space disabled
data page size: D (default)
instruction page size: D (default)
nulptr references disabled
shared library private mapping disabled
#
Please let me know as I am not able to enable SHLIB path here.
Dennis Handly
Acclaimed Contributor

Re: DB starting error

>1. How can I check whether I have absolute path to SHLIB or Not?

What is the -L path you pass to the compiler in your makefile?

>export LD_LIBRARY_PATH

Useless for PA32, only SHLIB_PATH works.

>2. If I can't use +legacy_cpp on PA cc, then how can I set the CPP value then?

Just -E is enough.

>Regarding SHLIB path when I do an chatr on dld.sl

It is useless to do it on dld.sl. You must do it on your executable.

>I am not able to enable SHLIB path here.

To enable it on your executable, you link with "-Wl,+s". Or you can use chatr(1).
Shinji Teragaito_1
Respected Contributor
Solution

Re: DB starting error

Hi Sutapa,

I tried to build PostgreSQL from source code on HP-UX 11.11.

------------------------------
NOTE: I used the latest HP ANSI C compiler:
% cc -V hello.c -o hello
cpp.ansi: HP92453-01 B.11.11.20 HP C Preprocessor (ANSI)
ccom: HP92453-01 B.11.11.20 HP C Compiler
/usr/ccs/bin/ld: 92453-07 linker linker ld B.11.40 040530
%

Before upgrading to this, I met the following error:
cc -Ae +O2 -I../../../../src/include -D_XOPEN_SOURCE_EXTENDED -c -o elog.o elog.c
cc: error 1405: "/opt/ansic/lbin/ccom" terminated abnormally with signal 11.
------------------------------

Here's my simple steps:

% cd /var/tmp
% gzcat postgresql-8.3.4.tar.gz | tar xvf
% cd postgresql-8.3.4
% env CC=cc CFLAGS="+O2" ./configure \
--without-readline --without-zlib 2>&1 | tee configure.log
% gmake 2>&1 | tee make.log
% gmake check 2>&1 | tee makecheck.log
..(snip)..
=======================
All 114 tests passed.
=======================

gmake[2]: Leaving directory `/var/tmp/postgresql-8.3.4/src/test/regress'
gmake[1]: Leaving directory `/var/tmp/postgresql-8.3.4/src/test'
% su -
# cd /var/tmp/postgresql-8.3.4
# /usr/local/bin/gmake install 2>&1 | tee makeinstall.log
# useradd postgres
# mkdir /usr/local/pgsql/data
# chown postgres:users /usr/local/pgsql/data
# su - postgres

$ export PGDATA=/usr/local/pgsql/data
$ export PGLIB=/usr/local/pgsql/lib
$ export PATH=/usr/local/pgsql/bin:$PATH
% initdb --encoding=EUC_JP --no-locale
$ pg_ctl -w start
$ ps -ef | grep postgres
postgres 21403 21397 0 09:17:43 ? 0:00 postgres: wal writer process
postgres 21404 21397 0 09:17:43 ? 0:00 postgres: autovacuum launcher process
postgres 22263 21937 2 09:40:33 pts/ta 0:00 ps -ef
postgres 21405 21397 0 09:17:43 ? 0:00 postgres: stats collector process
postgres 21397 1 0 09:17:42 pts/ta 0:00 /usr/local/pgsql/bin/postgres
postgres 21402 21397 0 09:17:43 ? 0:00 postgres: writer process
postgres 21937 21922 1 09:32:07 pts/ta 0:00 -sh
postgres 22264 21937 0 09:40:33 pts/ta 0:00 grep postgres
$
$ psql -l
List of databases
Name | Owner | Encoding
-----------+----------+----------
postgres | postgres | EUC_JP
template0 | postgres | EUC_JP
template1 | postgres | EUC_JP
(3 rows)

$ createdb sample
$ psql -l
List of databases
Name | Owner | Encoding
-----------+----------+----------
postgres | postgres | EUC_JP
sample | postgres | EUC_JP
template0 | postgres | EUC_JP
template1 | postgres | EUC_JP
(4 rows)

$
$ chatr /usr/local/pgsql/bin/createdb
/usr/local/pgsql/bin/createdb:
shared executable
shared library dynamic path search:
SHLIB_PATH disabled second
embedded path enabled first /usr/local/pgsql/lib
shared library list:
dynamic ../../../src/interfaces/libpq/libpq.sl.5
dynamic /usr/lib/libxnet.2
dynamic /usr/lib/libm.2
dynamic /usr/lib/libc.2
shared library binding:
..(snip)..
$ ldd /usr/local/pgsql/bin/createdb
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libm.2 => /usr/lib/libm.2
/usr/lib/libxnet.2 => /usr/lib/libxnet.2
/usr/lib/libxti.2 => /usr/lib/libxti.2
../../../src/interfaces/libpq/libpq.sl.5 => /usr/local/pgsql/lib/libpq.sl.5
$ ldd /usr/local/pgsql/bin/createlang
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libm.2 => /usr/lib/libm.2
/usr/lib/libxnet.2 => /usr/lib/libxnet.2
/usr/lib/libxti.2 => /usr/lib/libxti.2
../../../src/interfaces/libpq/libpq.sl.5 => /usr/local/pgsql/lib/libpq.sl.5
$

I didn't specify "--with-perl" to the configure script. But it
seems to me my PostgreSQL is working well.

I hope this helps you.
Sutapa Dey
Frequent Advisor

Re: DB starting error

Hi All,

Lots of thanks for your help. It has made my understanding better.

Terajito, for you I have one question when I performed the last steps as given by you:

1. chatr /usr/bin/createdb - I got the same result as you.
2. But in the next step
ldd /usr/bin/createdb - The o/p I got is:

/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libcom_err.sl => /usr/lib/libcom_err.sl
/usr/lib/libk5crypto.sl => /usr/lib/libk5crypto.sl
/usr/lib/libkrb5.sl => /usr/lib/libkrb5.sl
/usr/lib/libcom_err.sl => /usr/lib/libcom_err.sl
/usr/lib/libk5crypto.sl => /usr/lib/libk5crypto.sl
/usr/lib/libm.2 => /usr/lib/libm.2
/usr/lib/libcrypto.sl.0 => /usr/lib/libcrypto.sl.0
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libssl.sl.0 => /usr/lib/libssl.sl.0
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libxnet.2 => /usr/lib/libxnet.2
/usr/lib/libxti.2 => /usr/lib/libxti.2
/usr/lib/dld.sl: Can't open shared library: ../../../src/interfaces/libpq/libpq.sl.5
/usr/lib/dld.sl: No such file or directory

Please notice the last two lines. They are throwing some error. It is the same case with /usr/bin/createlang.

Please let me know your suggestions.

Regards,
Sutapa
Shinji Teragaito_1
Respected Contributor

Re: DB starting error

> 1. chatr /usr/bin/createdb - I got the same result as you.

You should not have. You should have /opt/iexpress/postgresql/lib/hpux32 as the embedded path because you specify the directory as --libdir and your libpq.sl is present there.

Can you remove the configuration for LDFLAGS="-Wl,+nodefaultrpath" ?

Dennis Handly
Acclaimed Contributor

Re: DB starting error

>Shinji: Can you remove the configuration for LDFLAGS="-Wl,+nodefaultrpath"?

This will obviously make it work. I.e. if it found it at link time, it will still be there at runtime, if on the same machine or shlib layout.