Thread: Permissions or initdb failure?

Permissions or initdb failure?

From
"Tom Halser"
Date:
Installed Postgre as usual on Cygwin with XP prof. and a postgres user
account, as describe in documentation. (Did it before on other machines
and worked well)

Now loging in to 'postgres' user to initalize the database, this happens:

$ initdb -D /var/lib/pgsql/data
The program 'postgres' is needed by initdb but was not found in
the directory '/usr/bin'.  Check your installation.

Installed with CYGWIN=binmode tty ntsec
cygipc installed as service and running...

Does anybody know what went wrong?
Thank you
Tom


Re: Permissions or initdb failure?

From
Jason Tishler
Date:
Tom,

On Tue, Feb 18, 2003 at 04:22:35PM +0100, Tom Halser wrote:
> $ initdb -D /var/lib/pgsql/data
> The program 'postgres' is needed by initdb but was not found in
> the directory '/usr/bin'.  Check your installation.
>
> Does anybody know what went wrong?

What is the permissions of /usr/bin/postgres.exe?

    $ ls -l /usr/bin/postgres.exe
    -rwxr-xr-x    1 Administ None      1979392 Dec  3 09:27 /usr/bin/postgres.exe

Is it executable by all?  If not, then make it so.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Permissions or initdb failure?

From
Jason Tishler
Date:
Tom,

Please keep your replies on-list.

On Wed, Feb 19, 2003 at 09:07:16AM +0100, Tom Halser wrote:
> okay. did chmod 715 to 'postgres.exe'
> After that initdb had the same problem with 'pg_id.exe'.
> So I did 'chmod 715 /usr/bin/pg_*' in hope this would fix all permission
> problems.

A mode of 715 is weird -- I would use 755.

> Running initdb now results this:
> $ initdb -D /var/lib/pgsql/data
> The files belonging to this database system will be owned by user
> "postgres".
> This user must also own the server process.
>
> The database cluster will be initialized with locale C.
>
> Fixing permissions on existing directory /var/lib/pgsql/data... ok
> creating directory /var/lib/pgsql/data/base... ok
> creating directory /var/lib/pgsql/data/global... ok
> creating directory /var/lib/pgsql/data/pg_xlog... ok
> creating directory /var/lib/pgsql/data/pg_clog... ok
> creating template1 database in /var/lib/pgsql/data/base/1... ok
> creating configuration files... ok
> initializing pg_shadow... LOG:  FindExec: invalid binary
> "/usr/bin/postgres"
> FATAL:  /usr/bin/postgres: could not locate executable, bailing out...
>
> initdb failed.
>
> The account 'postgres' has ordinary 'user' rights, should that be
> Administrator?

No, all of my postgres users are just in Users.

> What I really don't understand is that I already installed Postgres on
> another XP Prof machine the same way and everything work perfect.
> Strange.

My WAG is that the permissions of /usr/bin is whacked (i.e., not 777 or
at least 755) which is causing Cygwin's setup.exe to install *.exe and
*.dll files with bad permissions.

Try to fix your permissions with the following:

    $ chmod 755 /usr/bin
    $ chmod 755 /usr/bin/*.exe /usr/bin/*.dll

Does initdb work now?

> Thanks for your support!

You are welcome.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Permissions or initdb failure?

From
Jason Tishler
Date:
Tom,

Please keep your replies on-list.

On Thu, Feb 20, 2003 at 06:07:28PM +0100, Tom Halser wrote:
> :-)))
>
> yep, that helped.

Good.

> Still, I don't remember that I did that on the other
> machines...spooky!  The only other thing I did: I used a different
> account than the build-in Administator that had also administrator
> rights to install cygwin with setup.exe.

Did you "Install For" "All Users" or "Just Me"?

> Anyway. So if I get you right, its all cygwin's setup.exe fault, isn't
> it?

Yup.  There is work under way to make Cygwin's setup.exe honor ntsec,
etc. which should hopefully prevent this problem.

> An off-topic question on that:
> shouldn't there be a way to install, reinstall, remove packages via
> commandline?

Yes, there has been some work to implement this.  Unfortunately, more
needs to be done.

> I mean, some kind of dpkg and aptitude like it exists on Debian??

The above would be great.

> That would make updating serveral machines on a network much easier!

Agreed.

> What's your opinion about that?

I agree will all of the above, but I have no time to help because I'm
maxed out already.  Unfortunately, one has to choose their battles.

Would you like to help?  If so, then please subscribe to
cygwin-apps@cygwin.com jump on in.

> Ahmmm. I promise this was my lasy reply off-list, but I thought it was
> kind of irrelevant to other postgresql-users.

Maybe.  My hope is if I answer publically, then I may prevent even one
private email.  I know that I'm foolish to hope for such a thing, but
one has to try...

> Mea culpa.

No problem, but please keep your replies on-list.

> Thanks for all

You are welcome.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6