Re: BUG #5253: installer fails to populate data directory

From: Daniel Convissor <danielc(at)analysisandsolutions(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5253: installer fails to populate data directory
Date: 2009-12-23 16:32:20
Message-ID: 20091223163220.GA23149@panix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Sachin:

On Wed, Dec 23, 2009 at 02:19:41PM +0530, Sachin Srivastava wrote:
> Can you post the error part of the logs (%TEMP%\install-postgresql.log)?
> Mask out any passwords (if there are any).

I have attached it. Examining the log reveals some clues that I used to
manually populate the data directory...

cacls "C:\Program Files\PostgreSQL\8.4\data" /E /T /P postgres:F

cscript //NoLogo \
"C:\Program Files\PostgreSQL\8.4/installer/server/initcluster.vbs" \
"postgres" "postgres" "fakepassword" \
"C:\Program Files\PostgreSQL\8.4" \
"C:\Program Files\PostgreSQL\8.4\data" 5432 "DEFAULT"

I was then able to start the PostgreSQL service manually via the
services.msc interface. The service is being run as the "postgres" user.
Then I created a user and a database in PostgreSQL without incident.

Please note, that while running the cscript test, it complained a bit.
Here is the relevant portion of the output:

vvvvvv
Ensuring we can write to the data directory (using cacls):
The data is invalid.

The files belonging to this database system will be owned by user
"theadmin".
This user must also own the server process.
^^^^^^

So, there seems to be a couple bugs in initcluster.vbs:

1) What does it mean it can't write to the directory? Is the script
having the "postgres" user attempt to set the permissions on "data" via
cacls? Of course it can't. The script should have the admin user create
"data" and run the cacls granting permission to the postgres user. Then
to test if "postgres" has the proper permissions, touch a file inside
"data". If that works, excellent. If not, fall back to the admin having
ownership.

2) Ownership should be given to "postgres". Perhaps that's because of
the prior issue.

Thanks,

--Dan

--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409

Attachment Content-Type Size
install-postgresql--2009-12-23_02-21--brief.log text/plain 6.5 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Joachim Raue 2009-12-23 16:44:49 [Bug] COPY staments with paths containing non-ASCII characters under WinXP
Previous Message fwoncn 2009-12-23 15:49:46 BUG #5254: can't drop a table