Problems with initdb 8.0.1

Started by Rafael Martinez Guerreroalmost 21 years ago3 messages
#1Rafael Martinez Guerrero
r.m.guerrero@usit.uio.no

Hello

I have a problem running initdb 8.0.1. I get this error message when I
try to run this command in my system:

-------------------------------------------------------------------
-bash-2.05b$ /local/opt/postgresql/bin/initdb
The program "postgres" is needed by initdb but was not found in the
same directory as
"/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin/initdb@386linuxlibc63".
Check your installation.
-------------------------------------------------------------------

strace shows this:
-------------------------------------------------------------------
......
......
getcwd("/", 1024) = 10
chdir("/local/opt/postgresql/bin") = 0
lstat64("initdb", {st_mode=S_IFLNK|0777, st_size=82, ...}) = 0
readlink("initdb",
"/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin/initdb@386linuxlibc63", 1024) = 82
chdir("/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin") =
0
lstat64("initdb@386linuxlibc63", {st_mode=S_IFREG|0755, st_size=47506,
...}) = 0
getcwd("/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin",
1024) = 73
chdir("/") = 0
write(2, "The program \"postgres\" is needed"..., 209The program
"postgres" is needed by initdb but was not found in the
same directory as
"/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin/initdb@386linuxlibc63".
Check your installation.
) = 209
exit_group(1) = ?
-------------------------------------------------------------------

Some additional information:
----------------------------
We are running a system for administration of third party software on
UNIX computers (store). With this system we can compile in a master
server versions for different platforms and different versions of the
software for a platform, distribution happens automatic.

This system is well tested and works without a problem. We have been
running the last 8-9 version of postgres in this system without a
problem.

What the system does is to create a symblink to the version for your
machine (among other things).

For example:

If we install the binaries for postgres under /local/opt/postgresql/bin,
initdb in this directory will be a symblink to
"/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin/initdb@386linuxlibc63
and

/local/opt/postgresql/bin/postgres will we a symblink to
/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin/postgres@386linuxlibc63.

if we are in a linux machine.

If we run the same version in a solaris machine:
/local/opt/postgresql/bin/initdb -->
/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin/initdb@sun4os58

and

/local/opt/postgresql/bin/postgres -->
/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin/postgres@sun4os58

Solution to the problem?:
-------------------------

I solution to this problem will be to look for postgres under the same
directory of initdb (/local/opt/postgresql/bin in our example) and not
under the directory of the initdb symblink target.

Any comment to this?
Thanks for your time.

--
Rafael Martinez, <r.m.guerrero@usit.uio.no>
Center for Information Technology Services
University of Oslo, Norway

#2Andrew Dunstan
andrew@dunslane.net
In reply to: Rafael Martinez Guerrero (#1)
Re: Problems with initdb 8.0.1

Rafael Martinez Guerrero wrote:

Hello

I have a problem running initdb 8.0.1. I get this error message when I
try to run this command in my system:

-------------------------------------------------------------------
-bash-2.05b$ /local/opt/postgresql/bin/initdb
The program "postgres" is needed by initdb but was not found in the
same directory as
"/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin/initdb@386linuxlibc63".
Check your installation.
-------------------------------------------------------------------

strace shows this:
-------------------------------------------------------------------
......
......
getcwd("/", 1024) = 10
chdir("/local/opt/postgresql/bin") = 0
lstat64("initdb", {st_mode=S_IFLNK|0777, st_size=82, ...}) = 0
readlink("initdb",
"/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin/initdb@386linuxlibc63", 1024) = 82
chdir("/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin") =
0
lstat64("initdb@386linuxlibc63", {st_mode=S_IFREG|0755, st_size=47506,
...}) = 0
getcwd("/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin",
1024) = 73
chdir("/") = 0
write(2, "The program \"postgres\" is needed"..., 209The program
"postgres" is needed by initdb but was not found in the
same directory as
"/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin/initdb@386linuxlibc63".
Check your installation.
) = 209
exit_group(1) = ?
-------------------------------------------------------------------

Some additional information:
----------------------------
We are running a system for administration of third party software on
UNIX computers (store). With this system we can compile in a master
server versions for different platforms and different versions of the
software for a platform, distribution happens automatic.

This system is well tested and works without a problem. We have been
running the last 8-9 version of postgres in this system without a
problem.

What the system does is to create a symblink to the version for your
machine (among other things).

For example:

If we install the binaries for postgres under /local/opt/postgresql/bin,
initdb in this directory will be a symblink to
"/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin/initdb@386linuxlibc63
and

/local/opt/postgresql/bin/postgres will we a symblink to
/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin/postgres@386linuxlibc63.

if we are in a linux machine.

If we run the same version in a solaris machine:
/local/opt/postgresql/bin/initdb -->
/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin/initdb@sun4os58

and

/local/opt/postgresql/bin/postgres -->
/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin/postgres@sun4os58

Solution to the problem?:
-------------------------

I solution to this problem will be to look for postgres under the same
directory of initdb (/local/opt/postgresql/bin in our example) and not
under the directory of the initdb symblink target.

Any comment to this?
Thanks for your time.

What a very strange arrangement. Why not symlink the install dirs and
leave the executable names alone? Mangling the names of the executables
is surely a recipe for a hole in the foot - that you've got away with it
up to now seems more a matter of luck than good management ;-)

cheers

andrew

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Rafael Martinez Guerrero (#1)
Re: Problems with initdb 8.0.1

Rafael Martinez Guerrero <r.m.guerrero@usit.uio.no> writes:

If we install the binaries for postgres under /local/opt/postgresql/bin,
initdb in this directory will be a symblink to
"/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin/initdb@386lin=
uxlibc63=20
and=20

/local/opt/postgresql/bin/postgres will we a symblink to
/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/bin/postgres@386li=
nuxlibc63.

This naming convention is broken. Fix it by putting the platform info
into the path instead, perhaps

/local/store/bbking/.postgresql/ver-8.0.1/opt/postgresql/386linuxlibc63/bin/postgres

The symlink following code is necessary to support relocatable
installations, and we aren't going to change it.

regards, tom lane