Thread: initdb failing: Invalid binary "/usr/bin/postgres"?

initdb failing: Invalid binary "/usr/bin/postgres"?

From
"Davide Bruzzone"
Date:
Greetings all...

I'm in the process of setting up Cygwin/PostgreSQL (7.2.1-2) on a
Windows XP Professional machine, and am having trouble running initdb.
Here's what's happening (Note: I'm logged in as the postgres user when
I execute the following command. Also, ipc-daemon is running, and was
started with "ipc-daemon&"):

$ initdb -D /usr/share/postgresql/data
The files belonging to this database system will be owned by user
"postgres".
This user must also own the server process.

Fixing permissions on existing directory /usr/share/postgresql/data...
ok
creating directory /usr/share/postgresql/data/base... ok
creating directory /usr/share/postgresql/data/global... ok
creating directory /usr/share/postgresql/data/pg_xlog... ok
creating directory /usr/share/postgresql/data/pg_clog... ok
creating template1 database in /usr/share/postgresql/data/base/1... ok
creating configuration files... ok
initializing pg_shadow... FindExec: invalid binary "/usr/bin/postgres"
FATAL 1:  /usr/bin/postgres: could not locate executable, bailing
out...

initdb failed.

If I go and look in /usr/bin, I find postgres.exe, and postmaster
(Which is a symlink to postgres.exe).

Has anyone seen this before? Can anyone point me in the direction of
some information regarding this problem?

Any help would be greatly appreciated...

Cheers...

Dave Bruzzone




Re: initdb failing: Invalid binary "/usr/bin/postgres"?

From
Jason Tishler
Date:
Dave,

On Sun, Jul 07, 2002 at 11:53:00AM -0600, Davide Bruzzone wrote:
> $ initdb -D /usr/share/postgresql/data
> [snip]
> initializing pg_shadow... FindExec: invalid binary "/usr/bin/postgres"
> FATAL 1:  /usr/bin/postgres: could not locate executable, bailing out...

I was able to reproduce the above problem by doing the following:

    $ chmod g-x,o-x /usr/bin/postgres.exe

> If I go and look in /usr/bin, I find postgres.exe, and postmaster
> (Which is a symlink to postgres.exe).

What is the output of the following?

    $ ls -l /usr/bin/postgres.exe
    -rwxrw-rw-    1 Administ Domain U  2708992 Jun 10 08:13 /usr/bin/postgres.exe
          ^  ^
          *  *

If it is the same as or similar to the above (i.e., missing group and/or
other execute permissions), then do the following to fix your
permissions:

    $ chmod +x /usr/bin/postgres.exe

Does this solve your problem?

> Has anyone seen this before?

No.

> Can anyone point me in the direction of some information regarding
> this problem?

See above

But, the really question is why did your permissions get whacked if my
WAG is correct?

Jason



Re: initdb failing: Invalid binary "/usr/bin/postgres"?

From
"Jim George"
Date:
Have you checked the permission of /usr/bin and postgres.exe?  Are both R-X
at least for the postgres user?


Jim

----- Original Message -----
From: "Davide Bruzzone" <dbruzzone@attbi.com>
To: <pgsql-cygwin@postgresql.org>
Sent: Sunday, July 07, 2002 6:53 PM
Subject: [CYGWIN] initdb failing: Invalid binary "/usr/bin/postgres"?


> Greetings all...
>
> I'm in the process of setting up Cygwin/PostgreSQL (7.2.1-2) on a
> Windows XP Professional machine, and am having trouble running initdb.
> Here's what's happening (Note: I'm logged in as the postgres user when
> I execute the following command. Also, ipc-daemon is running, and was
> started with "ipc-daemon&"):
>
> $ initdb -D /usr/share/postgresql/data
> The files belonging to this database system will be owned by user
> "postgres".
> This user must also own the server process.
>
> Fixing permissions on existing directory /usr/share/postgresql/data...
> ok
> creating directory /usr/share/postgresql/data/base... ok
> creating directory /usr/share/postgresql/data/global... ok
> creating directory /usr/share/postgresql/data/pg_xlog... ok
> creating directory /usr/share/postgresql/data/pg_clog... ok
> creating template1 database in /usr/share/postgresql/data/base/1... ok
> creating configuration files... ok
> initializing pg_shadow... FindExec: invalid binary "/usr/bin/postgres"
> FATAL 1:  /usr/bin/postgres: could not locate executable, bailing
> out...
>
> initdb failed.
>
> If I go and look in /usr/bin, I find postgres.exe, and postmaster
> (Which is a symlink to postgres.exe).
>
> Has anyone seen this before? Can anyone point me in the direction of
> some information regarding this problem?
>
> Any help would be greatly appreciated...
>
> Cheers...
>
> Dave Bruzzone
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
>




Re: initdb failing: Invalid binary "/usr/bin/postgres"?

From
dbruzzone@attbi.com
Date:
That did it (Although as Jim George suggested, it
wasn't happy until I added both read and execute
privileges to the executable)! Thank you...

BTW, the executable had only "rwx" for the user when I
did an ls -al!...

Don't know what caused this... The Cygwin installation
is a fresh one, and I installed it on the machine as
another user.

--
Thanks again...

Dave
> > $ initdb -D /usr/share/postgresql/data
> > [snip]
> > initializing pg_shadow... FindExec: invalid binary "/usr/bin/postgres"
> > FATAL 1:  /usr/bin/postgres: could not locate executable, bailing out...
>
> I was able to reproduce the above problem by doing the following:
>
>     $ chmod g-x,o-x /usr/bin/postgres.exe
>
> > If I go and look in /usr/bin, I find postgres.exe, and postmaster
> > (Which is a symlink to postgres.exe).
>
> What is the output of the following?
>
>     $ ls -l /usr/bin/postgres.exe
>     -rwxrw-rw-    1 Administ Domain U  2708992 Jun 10 08:13
> /usr/bin/postgres.exe
>           ^  ^
>           *  *
>
> If it is the same as or similar to the above (i.e., missing group and/or
> other execute permissions), then do the following to fix your
> permissions:
>
>     $ chmod +x /usr/bin/postgres.exe
>
> Does this solve your problem?
>
> > Has anyone seen this before?
>
> No.
>
> > Can anyone point me in the direction of some information regarding
> > this problem?
>
> See above
>
> But, the really question is why did your permissions get whacked if my
> WAG is correct?



Re: initdb failing: Invalid binary "/usr/bin/postgres"?

From
Jason Tishler
Date:
Dave,

On Mon, Jul 08, 2002 at 11:05:59PM +0000, dbruzzone@attbi.com wrote:
> BTW, the executable had only "rwx" for the user when I
> did an ls -al!...
>
> Don't know what caused this... The Cygwin installation
> is a fresh one, and I installed it on the machine as
> another user.

Please use Cygwin's setup.exe to re-install PostgreSQL and then perform
the following:

    $ ls -l /usr/bin/postgres.exe

What is the output of the above command?

Thanks,
Jason

Re: initdb failing: Invalid binary "/usr/bin/postgres"?

From
dbruzzone@attbi.com
Date:
Jason,

Here's the output after a fresh install (PostgreSQL 7.2.1-2):

$ ls -l /usr/bin/postgres.exe
-rwx------    1 Davide   None      2708992 Jun 10 06:13 /usr/bin/postgres.exe

> Please use Cygwin's setup.exe to re-install PostgreSQL and then perform
> the following:
>
>     $ ls -l /usr/bin/postgres.exe
>
> What is the output of the above command?

Cheers...

Dave

Re: initdb failing: Invalid binary "/usr/bin/postgres"?

From
Jason Tishler
Date:
Dave,

On Wed, Jul 10, 2002 at 07:57:26PM +0000, dbruzzone@attbi.com wrote:
> Here's the output after a fresh install (PostgreSQL 7.2.1-2):
>
> $ ls -l /usr/bin/postgres.exe
> -rwx------    1 Davide   None      2708992 Jun 10 06:13 /usr/bin/postgres.exe

The above is bad.

What is the output of the following command?

    $ ls -ld /usr/bin

My WAG is that you will get something like following:

    drwx------    2 Davide   None            0 Jul 11 09:16 /usr/bin

Am I correct?  If so, then your Cygwin setup is not correct.

Use the following to fix at least this aspect:

    $ chown 544 /usr/bin
    $ chmod 755 /usr/bin

Try re-installing PostgreSQL (again).  Does /usr/bin/postgres.exe
install with the appropriate permissions?

Thanks,
Jason

Re: initdb failing: Invalid binary "/usr/bin/postgres"?

From
dbruzzone@attbi.com
Date:
> What is the output of the following command?
>
>     $ ls -ld /usr/bin
>
> My WAG is that you will get something like following:
>
>     drwx------    2 Davide   None            0 Jul 11
09:16 /usr/bin
>
> Am I correct?

Yes.

> Use the following to fix at least this aspect:
>
>     $ chown 544 /usr/bin
>     $ chmod 755 /usr/bin
>
> Try re-installing PostgreSQL (again).
Does /usr/bin/postgres.exe
> install with the appropriate permissions?

It worked... Don't know why the directory permissions
would be wrong on a fresh Cygwin install though...

Cheers...

Dave

Re: initdb failing: Invalid binary "/usr/bin/postgres"?

From
s0lao@netscape.net (S. L.)
Date:
[...]
>
>It worked... Don't know why the directory permissions
>would be wrong on a fresh Cygwin install though...
>
[...]

Could it be installing "only for the current user" ?
I mean either this is the way that sort of installation works, or "the current user" couldn't set the proper
permissions.


SLao


__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with
Shop@Netscape!http://shopnow.netscape.com/ 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/