Re: initdb failure with PostgreSQL 7.3.2 / Cygwin 1.3.22-1 / - Mailing list pgsql-cygwin

From Jason Tishler
Subject Re: initdb failure with PostgreSQL 7.3.2 / Cygwin 1.3.22-1 /
Date
Msg-id 20030505115632.GC556@tishler.net
Whole thread Raw
In response to Re: initdb failure with PostgreSQL 7.3.2 / Cygwin 1.3.22-1 /  (Frank Seesink <frank@mail.wvnet.edu>)
Responses Re: initdb failure with PostgreSQL 7.3.2 / Cygwin 1.3.22-1 /
List pgsql-cygwin
Frank,

On Fri, May 02, 2003 at 12:58:22PM -0400, Frank Seesink wrote:
> Jason Tishler wrote:
> ...[snip]...
> >Please run the attached program under both the Frank and postgres
> >user accounts to confirm or refute the above hypothesis and report
> >back to the list.
>
> Confirmed.  Here's the output run as both 'Frank' (the admin level
> acct) and 'postgres':
> ______________________________________________________________________
> Frank@SEESINK /tmp
> $ ./cit
> 1892 = OpenSemaphore() succeeded
> ______________________________________________________________________
> postgres@SEESINK /tmp
> $ ./cit
> OpenSemaphore() failed with last error = 2
> ______________________________________________________________________

The above is very interesting.  I expected cit to fail under postgres
but not with a last error of 2:

    $ fgrep 2L /usr/include/w32api/winerror.h | head -1
    #define ERROR_FILE_NOT_FOUND 2L

Actually, I expected a last error of 5:

    $ fgrep 5L /usr/include/w32api/winerror.h | head -1
    #define ERROR_ACCESS_DENIED 5L

Hence, your problem appears to be more insidious than a simple
permissions problem.

> Note that if I shutdown CygIPC and run the command from 'Frank', the
> results are identical to the 'postgres' results.  So yes, indeed, it
> looks as if to the 'postgres' user, CygIPC does not exist/is not
> responding/cannot be accessed.  Now the mother of all questions:  why?
> Why does it work for you and not for me in XP?

I don't know.  I appears that the semaphores created by ipc-daemon are
not accessible by users other than Frank.

I have another idea.  Please download the handle utility from
Sysinternals:

    http://www.sysinternals.com/ntw2k/freeware/handle.shtml

run the following when ipc-daemon is running under LocalSystem:

    $ handle -a -p ipc-daemon | fgrep Multi
       d8: Semaphore     \BaseNamedObjects\MultiSemCtl_
       dc: Semaphore     \BaseNamedObjects\MultiSemSem_
       e0: Semaphore     \BaseNamedObjects\MultiSemShm_
       e4: Semaphore     \BaseNamedObjects\MultiSemMsg_
       e8: File          C:\Cygwin\tmp\MultiFileSem
       f0: File          C:\Cygwin\tmp\MultiFileShm
       f8: File          C:\Cygwin\tmp\MultiFileMsg

and post your results to the list.

> Do you run a vanilla XP config?

I did not install the XP box that I'm testing on, but I believe that it
is "vanilla."

> If not, what changes if any do you make?

I will check with the installer, but assume that none were made unless I
indicate otherwise.

> I can't think of any apps which would get in the way of this, but
> then, I'm not 100% clear on how CygIPC is contacted.

ipc-daemon is contacted by opening semaphores -- exactly how cit does
it.  If not, why would I ask you to run cit?

> And as mentioned, I've tried running CygIPC AS user 'postgres', and
> even that did not work.

The above is truly amazing!

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


pgsql-cygwin by date:

Previous
From: Jason Tishler
Date:
Subject: Re: initdb failure with PostgreSQL 7.3.2 / Cygwin 1.3.22-1 /
Next
From: Jason Tishler
Date:
Subject: Re: initdb failure with PostgreSQL 7.3.2 / Cygwin 1.3.22-1 /