Re: initdb error

From: David Noel <david(dot)i(dot)noel(at)gmail(dot)com>
To: Amitabh Kant <amitabhkant(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>, PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: initdb error
Date: 2012-12-15 15:10:27
Message-ID: CAHAXwYDzuuEDPQTnJQ3TVNNQFa7=R48n4HMSVniPq23tfc6k5g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ugh. It turns out I had security.bsd.hardlink_check_gid=1 and
security.bsd.hardlink_check_uid=1 in sysctl.conf. Setting them to 0
fixed everything. That's frustrating. Sorry for all the trouble. Many
thanks for helping resolve this.

On 12/15/12, Amitabh Kant <amitabhkant(at)gmail(dot)com> wrote:
> David
>
> I just tried installing PG 9.2.2 on FreeBSD 8.3 and initdb went smoothly
> without any problems. the only difference would be that I had it running in
> a virtualbox instance. My config were as follows;
>
> FreeBSD 8.3-RELEASE-p5 (binary updated through freebsd-update)
> PG 9.2.2 (installed through ports)
> root filesystem on UFS
> ZFS mounted on /example
> PG data directory set to /example/pgsql/data
>
> relevant rc.conf entries:
> postgresql_enable="YES"
> postgresql_data="/example/pgsql/data"
>
> running "/usr/local/etc/rc.d/postgresql initdb" works perfectly. Just
> needed to set the correct permissions on /example/pgsql directory.
>
> Amitabh
>
>
>
>
> On Sat, Dec 15, 2012 at 10:32 AM, David Noel <david(dot)i(dot)noel(at)gmail(dot)com>
> wrote:
>
>> > You need to talk to some FreeBSD kernel hackers about why link()
>> > might be failing here. Since you see it on UFS too, we can probably
>> > exonerate the ZFS filesystem-specific code.
>> >
>> > I did some googling and found that EPERM can be issued if the
>> > filesystem
>> > doesn't support hard links (which shouldn't apply to ZFS I trust).
>> > Also, Linux has a "protected_hardlinks" option that causes certain
>> > attempts at creating hard links to fail --- but our use-case here
>> > doesn't fall foul of any of those restrictions AFAICS, and of course
>> > FreeBSD isn't Linux. Still, I wonder if you're running into some
>> > misdesigned or misimplemented security restriction. You might want
>> > to look at your kernel parameters and see if any of them look like
>> > they might have to do with restricting hard-link operations.
>> >
>> > Also, since Amitabh failed to duplicate the failure on both earlier
>> > and later FreeBSD kernels, and we've not heard reports of this from
>> > anybody else either, it seems more than possible that it's a plain
>> > old bug in the specific kernel version you're using.
>> >
>> > As a short-term workaround, I'd suggest rebuilding with
>> > HAVE_WORKING_LINK disabled. (Just remove that #define from
>> > src/include/pg_config_manual.h and rebuild.)
>>
>> OK, thanks. I've gotten in touch with the freebsd-hackers mailing
>> list. Hopefully we'll be able to get this one figured out.
>>
>> I compiled a GENERIC kernel and tried it again. Still no luck. But at
>> least we know now it wasn't a configuration error.
>>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-12-15 16:28:44 Re: initdb error
Previous Message hubert depesz lubaczewski 2012-12-15 15:06:10 Re: [COMMITTERS] pgsql: Allow a streaming replication standby to follow a timeline switc