Re: initdb must have write access to /tmp

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rich Bodo <rsb(at)ostel(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: initdb must have write access to /tmp
Date: 2001-10-01 22:17:32
Message-ID: 4928.1001974652@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Rich Bodo <rsb(at)ostel(dot)com> writes:
> I was just installing postgres 7.1.2 on my linux mandrake 7.2
> system and the build and install went fine up to the point I
> had to run:
> initdb -D /usr/local/pgsql/data
> which segfaulted. I changed the permissions on /tmp to 777
> and all was well. I think initdb could use an if statement to
> check the permissions on /tmp and report a descriptive bug.

I cannot replicate this in current sources; I get

creating directory /home/postgres/testversion/data... ok
creating directory /home/postgres/testversion/data/base... ok
creating directory /home/postgres/testversion/data/global... ok
creating directory /home/postgres/testversion/data/pg_xlog... ok
creating directory /home/postgres/testversion/data/pg_clog... ok
creating template1 database in /home/postgres/testversion/data/base/1... ok
creating configuration files... ok
initializing pg_shadow... /home/postgres/testversion/bin/initdb[505]: /tmp/sh4843.13: Cannot find or open the file.

initdb failed.
Removing /home/postgres/testversion/data.

which seems like reasonable behavior to me. On another machine I get
something about "Cannot create temp file for here document: Permission
denied".

My guess is that the core dump you are seeing is actually your shell's
fault, not Postgres'; probably the shell is not expecting a create of
its temp file to fail. If so, it would be inappropriate for us to put
in a test for /tmp writability, since that would be making an
unsupported assumption about where the local shell puts its internal
temp files.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Vince Vielhaber 2001-10-02 00:31:47 Re: CVS rejected me
Previous Message Brent R. Matzelle 2001-10-01 21:10:16 Re: [HACKERS] [BUGS] PostgreSQL / PHP Overrun Error