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-28 00:18:36
Message-ID: 200501280018.j0S0Iawg008096@minddrive.numenor.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In message <22095(dot)1106869848(at)sss(dot)pgh(dot)pa(dot)us>, Tom Lane writes:
>Kenneth Lareau <elessar(at)numenor(dot)org> writes:
>> In message <21723(dot)1106868138(at)sss(dot)pgh(dot)pa(dot)us>, Tom Lane writes:
>>> 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.
>
>> Actually, creating the 'data' directory first doesn't work either:
>
>Good point.
>
>> 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.
>
>Could you truss that and see what it does? It would be a simple change
>in initdb to make it stat before mkdir instead of after, but I'm not
>totally convinced that would fix the problem. If mkdir returns a funny
>error code then stat might as well ...
>
> regards, tom lane
>

Here's the relevant truss output from 'mkdir /software/postgresql-8.0.0'
on my Solaris 9 system:

10832: umask(0) = 077
10832: umask(077) = 0
10832: mkdir("/software/postgresql-8.0.0", 0777) Err#89 ENOSYS
10832: stat64("/software/postgresql-8.0.0", 0xFFBFFA38) = 0
10832: fstat64(2, 0xFFBFEB78) = 0
10832: write(2, " m k d i r", 5) = 5
10832: write(2, " : ", 2) = 2
10832: write(2, " c a n n o t c r e a t".., 24) = 24
10832: write(2, " ` / s o f t w a r e / p".., 28) = 28
10832: write(2, " : ", 2) = 2
10832: write(2, " F i l e e x i s t s", 11) = 11
10832: write(2, "\n", 1) = 1
10832: _exit(1)

It's doing the stat after the mkdir attempt it seems, and coming back
with the correct response. Hmm, maybe I should look at the Solaris 8
code for the mkdir command...

Ken Lareau
elessar(at)numenor(dot)org

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2005-01-28 00:28:25 Re: Strange issue with initdb on 8.0 and Solaris automounts
Previous Message Tom Lane 2005-01-27 23:50:48 Re: Strange issue with initdb on 8.0 and Solaris automounts