Re: initdb failed on Windows 2000

Lists: pgsql-hackers
From: Yoshiyuki Asaba <y-asaba(at)sraoss(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: initdb failed on Windows 2000
Date: 2007-08-27 11:46:35
Message-ID: 20070827.204635.168593305.y-asaba@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

I have compiled PostgreSQL 8.2.4 with MinGW on Windows 2000. Then I
have executed initdb as Administrator. However initdb failed with the
following message.

----
The program "postgres" is needed by initdb but was not found in the
same directory as "C:\msys\1.0\local\pgsql\bin/initdb".
Check your installation.
----

So, I have debugged initdb.exe. I found that CreatePipe() was failed
with ERROR_ACCESS_DENIED in exec.c:pipe_read_line().

Does anyone know why CreatePipe() was failed with ERROR_ACCESS_DENIED?
Or is there a way that Administrator can execute initdb.exe on Windows
2000?

Regards,
--
Yoshiyuki Asaba
y-asaba(at)sraoss(dot)co(dot)jp


From: Yoshiyuki Asaba <y-asaba(at)sraoss(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: initdb failed on Windows 2000
Date: 2007-08-29 07:38:06
Message-ID: 20070829.163806.220052165.y-asaba@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

From: Yoshiyuki Asaba <y-asaba(at)sraoss(dot)co(dot)jp>
Subject: [HACKERS] initdb failed on Windows 2000
Date: Mon, 27 Aug 2007 20:46:35 +0900 (JST)

> I have compiled PostgreSQL 8.2.4 with MinGW on Windows 2000. Then I
> have executed initdb as Administrator. However initdb failed with the
> following message.
>
> ----
> The program "postgres" is needed by initdb but was not found in the
> same directory as "C:\msys\1.0\local\pgsql\bin/initdb".
> Check your installation.
> ----
>
> So, I have debugged initdb.exe. I found that CreatePipe() was failed
> with ERROR_ACCESS_DENIED in exec.c:pipe_read_line().

The attached files are test programs.

% gcc -o child.exe child.c
% gcc -o parent.exe parent.c

When parent.exe is executed by Power Users or Users, the result is
good. However, CreatePipe() is failed when Administrator do.

% ./parent.exe
CreatePipe() failed: 5

Regards,
--
Yoshiyuki Asaba
y-asaba(at)sraoss(dot)co(dot)jp

Attachment Content-Type Size
unknown_filename text/plain 2.7 KB
unknown_filename text/plain 569 bytes

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Yoshiyuki Asaba <y-asaba(at)sraoss(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: initdb failed on Windows 2000
Date: 2007-08-29 12:57:55
Message-ID: 46D56D53.2090908@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Yoshiyuki Asaba wrote:
>
>> I have compiled PostgreSQL 8.2.4 with MinGW on Windows 2000. Then I
>> have executed initdb as Administrator. However initdb failed with the
>> following message.
>>
>> ----
>> The program "postgres" is needed by initdb but was not found in the
>> same directory as "C:\msys\1.0\local\pgsql\bin/initdb".
>> Check your installation.
>> ----
>>
>> So, I have debugged initdb.exe. I found that CreatePipe() was failed
>> with ERROR_ACCESS_DENIED in exec.c:pipe_read_line().
>>
>
> The attached files are test programs.
>
> % gcc -o child.exe child.c
> % gcc -o parent.exe parent.c
>
> When parent.exe is executed by Power Users or Users, the result is
> good. However, CreatePipe() is failed when Administrator do.
>
> % ./parent.exe
> CreatePipe() failed: 5
>
>
>

What do you want us to do about it? Isn't this a case of "don't do that,
then"? Run initdb as some other user. We don't let you run initdb as
root on Unix, so we're just being consistent. In fact, we're being more
liberal on Windows than on Unix because we make some provision for the
restricted token gadget.

cheers

andrew


From: Yoshiyuki Asaba <y-asaba(at)sraoss(dot)co(dot)jp>
To: andrew(at)dunslane(dot)net
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: initdb failed on Windows 2000
Date: 2007-08-29 13:24:06
Message-ID: 20070829.222406.193693605.y-asaba@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: [HACKERS] initdb failed on Windows 2000
Date: Wed, 29 Aug 2007 08:57:55 -0400

> What do you want us to do about it? Isn't this a case of "don't do that,
> then"? Run initdb as some other user. We don't let you run initdb as
> root on Unix, so we're just being consistent. In fact, we're being more
> liberal on Windows than on Unix because we make some provision for the
> restricted token gadget.

Administrator can run initdb on Windows XP, Server 2003 and Vista.
Is this right?

--
Yoshiyuki Asaba
y-asaba(at)sraoss(dot)co(dot)jp


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Yoshiyuki Asaba <y-asaba(at)sraoss(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: initdb failed on Windows 2000
Date: 2007-08-29 13:51:26
Message-ID: 46D579DE.4020205@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Yoshiyuki Asaba wrote:
>
>
> Administrator can run initdb on Windows XP, Server 2003 and Vista.
> Is this right?
>
>
>

Well, I gave up on trying to get Vista to work, and I found I needed a
non-Administrator user to run my new buildfarm member on XP-Pro, so I
am means sure it is right.

cheers

andrew


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Yoshiyuki Asaba <y-asaba(at)sraoss(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: initdb failed on Windows 2000
Date: 2007-08-29 14:34:14
Message-ID: 46D583E6.6020908@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I wrote:
>
>
> so I am means sure it is right.
>
>

I meant, of course, "so I am by no means sure it is right"

That's what I get for multitasking.

cheers

andrew


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Yoshiyuki Asaba <y-asaba(at)sraoss(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: initdb failed on Windows 2000
Date: 2007-08-30 08:14:45
Message-ID: 20070830081445.GF14845@svr2.hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Aug 29, 2007 at 08:57:55AM -0400, Andrew Dunstan wrote:
>
>
> Yoshiyuki Asaba wrote:
> >
> >>I have compiled PostgreSQL 8.2.4 with MinGW on Windows 2000. Then I
> >>have executed initdb as Administrator. However initdb failed with the
> >>following message.
> >>
> >>----
> >>The program "postgres" is needed by initdb but was not found in the
> >>same directory as "C:\msys\1.0\local\pgsql\bin/initdb".
> >>Check your installation.
> >>----
> >>
> >>So, I have debugged initdb.exe. I found that CreatePipe() was failed
> >>with ERROR_ACCESS_DENIED in exec.c:pipe_read_line().
> >>
> >
> >The attached files are test programs.
> >
> > % gcc -o child.exe child.c
> > % gcc -o parent.exe parent.c
> >
> >When parent.exe is executed by Power Users or Users, the result is
> >good. However, CreatePipe() is failed when Administrator do.
> >
> > % ./parent.exe
> > CreatePipe() failed: 5
> >
> >
> >
>
> What do you want us to do about it? Isn't this a case of "don't do that,
> then"? Run initdb as some other user. We don't let you run initdb as
> root on Unix, so we're just being consistent. In fact, we're being more
> liberal on Windows than on Unix because we make some provision for the
> restricted token gadget.

FWIW, I regularly run initdb as administrator, and it works perfectly fine.
So what you need to do is to try to figure out *why* CreatePipe() fails.
Process Monitor or a debugger might help.

//Magnus


From: Yoshiyuki Asaba <y-asaba(at)sraoss(dot)co(dot)jp>
To: magnus(at)hagander(dot)net
Cc: andrew(at)dunslane(dot)net, pgsql-hackers(at)postgresql(dot)org
Subject: Re: initdb failed on Windows 2000
Date: 2007-08-31 06:23:21
Message-ID: 20070831.152321.45888341.y-asaba@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

From: Magnus Hagander <magnus(at)hagander(dot)net>
Subject: Re: [HACKERS] initdb failed on Windows 2000
Date: Thu, 30 Aug 2007 10:14:45 +0200

> On Wed, Aug 29, 2007 at 08:57:55AM -0400, Andrew Dunstan wrote:
> >
> >
> > Yoshiyuki Asaba wrote:
> > >
> > >>I have compiled PostgreSQL 8.2.4 with MinGW on Windows 2000. Then I
> > >>have executed initdb as Administrator. However initdb failed with the
> > >>following message.
> > >>
> > >>----
> > >>The program "postgres" is needed by initdb but was not found in the
> > >>same directory as "C:\msys\1.0\local\pgsql\bin/initdb".
> > >>Check your installation.
> > >>----
> > >>
> > >>So, I have debugged initdb.exe. I found that CreatePipe() was failed
> > >>with ERROR_ACCESS_DENIED in exec.c:pipe_read_line().
> > >>
> > >
> > >The attached files are test programs.
> > >
> > > % gcc -o child.exe child.c
> > > % gcc -o parent.exe parent.c
> > >
> > >When parent.exe is executed by Power Users or Users, the result is
> > >good. However, CreatePipe() is failed when Administrator do.
> > >
> > > % ./parent.exe
> > > CreatePipe() failed: 5
> > >
> > >
> > >
> >
> > What do you want us to do about it? Isn't this a case of "don't do that,
> > then"? Run initdb as some other user. We don't let you run initdb as
> > root on Unix, so we're just being consistent. In fact, we're being more
> > liberal on Windows than on Unix because we make some provision for the
> > restricted token gadget.
>
> FWIW, I regularly run initdb as administrator, and it works perfectly fine.

Hmm... I found the same report.

http://archives.postgresql.org/pgsql-bugs/2007-02/msg00083.php

> So what you need to do is to try to figure out *why* CreatePipe() fails.
> Process Monitor or a debugger might help.

OK, I'll try it.
Thank you!
--
Yoshiyuki Asaba
y-asaba(at)sraoss(dot)co(dot)jp