Re: Strange issue with initdb on 8.0 and Solaris automounts

From: Kenneth Lareau <elessar(at)numenor(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David Parker" <dparker(at)tazznetworks(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Strange issue with initdb on 8.0 and Solaris automounts
Date: 2005-01-27 23:35:41
Message-ID: 200501272335.j0RNZfwg007312@minddrive.numenor.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In message <21723(dot)1106868138(at)sss(dot)pgh(dot)pa(dot)us>, Tom Lane writes:
>"David Parker" <dparker(at)tazznetworks(dot)com> writes:
>> Did initdb previously just assume the -D path existed, and now it is
>> trying to create the whole path, if necessary?
>
>Pre-8.0 it was using mkdir(1), which might possibly contain some weird
>workaround for this case on Solaris.
>
>I suppose that manually creating the data directory before running
>initdb would also avoid this issue, since the mkdir(2) loop is only
>entered if we don't find the directory in existence.
>
> regards, tom lane
>

Actually, creating the 'data' directory first doesn't work either:

[delirium:postgres] ~
(17) mkdir data
[delirium:postgres] ~
(18) initdb -D /software/postgresql-8.0.0/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 /software/postgresql-8.0.0/data ... ok
creating directory /software/postgresql-8.0.0/data/global ... initdb: could not create directory "/software/postgresql-8.0.0": Operation not applicable
initdb: removing contents of data directory "/software/postgresql-8.0.0/data"

Since there's subdirectories that need to be created, it still runs into
the problem. I don't know why the command 'mkdir' doesn't exhibit the
same problem as the function 'mkdir', but running:

mkdir /software/postgresql-8.0.0

produces the correct error "File exists" on my system. I suspect the
'mkdir' command probably checks to see if the directory exists first
before trying to create it, which avoids the problem.

Ken Lareau
elessar(at)numenor(dot)org

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-01-27 23:50:48 Re: Strange issue with initdb on 8.0 and Solaris automounts
Previous Message Alvaro Herrera 2005-01-27 23:31:54 Re: bug w/ cursors and savepoints