Thread: postgre-7.4 and readline-4.3 /solaris 8

postgre-7.4 and readline-4.3 /solaris 8

From
Patrice Durosay
Date:
Hello All,

I have a problem when starting postgre under solaris 8 :

bash-2.03# su - postgres -c "/usr/local/pgsql/bin/pg_ctl -D /dat/pgsql/data -l pgsql.log start &"
bash-2.03# 5068 Killed
postmaster successfully started


generate a  /dat/pgsql/pgsql.log  file :
ld.so.1: /usr/local/pgsql/bin/postmaster: fatal: libreadline.so.4: open failed: No such file or directory

bash-2.03# locate libreadline.so.4
/opt/sfw/lib/libreadline.so.4
/usr/local/lib/libreadline.so.4

Postmaster did'nt start

postgre's user PATHs are correct
LD_LIBRARY_PATH=:/usr/lib:/usr/local/lib:/opt/sfw/lib:/usr/local/netpbm/lib:/usr/local/pgsql/lib:/usr/local/pbm/lib

PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/pgsql/bin:/opt/sfw/bin:/usr/dt/bin:/usr/ucb:/usr/local/netpb


Postmaster invocation don't do better.
# su - postgres -c "/usr/local/pgsql/bin/postmaster -D /dat/pgsql/data"
ld.so.1: /usr/local/pgsql/bin/postmaster: fatal: libreadline.so.4: open failed: No such file or directory
Killed


I reinstalled both  readline & postgresql without more success.
It seem to be there :

bash-2.03# ldd /usr/local/pgsql/bin/postgres
        libz.so =>       /usr/lib/libz.so
        libreadline.so.4 =>      /usr/local/lib/libreadline.so.4
        libcurses.so.1 =>        /usr/lib/libcurses.so.1
        librt.so.1 =>    /usr/lib/librt.so.1
        libresolv.so.2 =>        /usr/lib/libresolv.so.2
        libgen.so.1 =>   /usr/lib/libgen.so.1
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libm.so.1 =>     /usr/lib/libm.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1
        libaio.so.1 =>   /usr/lib/libaio.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        /usr/platform/SUNW,Sun-Fire-480R/lib/libc_psr.so.1


Can anybody help me to start it ?

Patrice Durosay


Re: postgre-7.4 and readline-4.3 /solaris 8

From
Tom Lane
Date:
Patrice Durosay <patrice.durosay@cgm.cnrs-gif.fr> writes:
> I reinstalled both  readline & postgresql without more success.
> It seem to be there :

> bash-2.03# ldd /usr/local/pgsql/bin/postgres
>         libz.so =>       /usr/lib/libz.so
>         libreadline.so.4 =>      /usr/local/lib/libreadline.so.4

That's a good start, but now look to see what libreadline.so depends on.

Also, if you are depending on LD_LIBRARY_PATH to make the linker find
these libraries, then make sure that the postgres account's .profile
sets up LD_LIBRARY_PATH the same way.  Remember that "su -" throws away
your environment and adopts the login environment of the target account.

            regards, tom lane

Re: postgre-7.4 and readline-4.3 /solaris 8

From
Patrice Durosay
Date:
Hi Tom,

Thank you for your remarks, They helped me to solve my problem under Solaris 8.

When I login as postgres, the paths are known  as defined in /etc/profile.
root & postgres are bash users.
no .profile nor .bashrc are defined in the postgres's home dir /dat/pgsql.
I created a .bashrc in the postgres's homedir that was not read by su.
su postgres -c "env" looses LD_LIBRARY_PATH
su - postgres -c "env" looses also PATH (replaced by one directory)

The only way I found to allow postgre launching via /etc/init.d/postgresql
is to add  a
RESTORE_LLP="source $PGDATA/.pathrc;"
in the command lines of the postgresql script :
 su - $PGUSER -c "$RESTORE_LLP $DAEMON start -D '$PGDATA' -s -l $PGLOG"

with the postgres .pathrc file :

# restore minimal LD_LIBRARY_PATH for postgres running
LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/usr/local/pgsql/lib
export LD_LIBRARY_PATH


Glad to be able to launch postgresql now. Many thanks.

Best regards

Patrice


Tom Lane a écrit :

> Patrice Durosay <patrice.durosay@cgm.cnrs-gif.fr> writes:
> > I reinstalled both  readline & postgresql without more success.
> > It seem to be there :
>
> > bash-2.03# ldd /usr/local/pgsql/bin/postgres
> >         libz.so =>       /usr/lib/libz.so
> >         libreadline.so.4 =>      /usr/local/lib/libreadline.so.4
>
> That's a good start, but now look to see what libreadline.so depends on.
>
> Also, if you are depending on LD_LIBRARY_PATH to make the linker find
> these libraries, then make sure that the postgres account's .profile
> sets up LD_LIBRARY_PATH the same way.  Remember that "su -" throws away
> your environment and adopts the login environment of the target account.