Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Dec 2012 17:43:56 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        David Noel <david.i.noel@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: postgres, initdb, FreeBSD bug?
Message-ID:  <20121215154356.GW71906@kib.kiev.ua>
In-Reply-To: <CAHAXwYCZUgk=VCgjE1Lccmi26BQGP5PfMOjfhYi5Weo=e9FMRQ@mail.gmail.com>
References:  <CAHAXwYA6o_hBpAvm=H4bpXNOKr7ec10zH30G3KWQXg7JEj0mDQ@mail.gmail.com> <20121215095324.GU71906@kib.kiev.ua> <CAHAXwYCZUgk=VCgjE1Lccmi26BQGP5PfMOjfhYi5Weo=e9FMRQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--tuYRN1zEaS85jg/Y
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Dec 15, 2012 at 09:02:34AM -0600, David Noel wrote:
> Ahh... the security.bsd. sysctl output had the answer: I had
> security.bsd.hardlink_check_gid and security.bsd.hardlink_check_uid
> set to 1 in sysctl.conf. Removing that fixed the problem.
Then, why did you set it ?

The sysctl indeed has an interesting interaction with the fact that the
created inode inherits gid from the parent directory. If you use it, you
must ensure that the directory group is in the group set of the process.

>=20
> Many thanks,
>=20
> -David
>=20
>=20
>=20
> > Show the ktrace from the same error on UFS.
>=20
>   5179 postgres CALL  unlink(0x7fffffffe570)
>   5179 postgres NAMI  "pg_notify/0000"
>   5179 postgres RET   unlink 0
>   5179 postgres CALL  getdirentries(0x3,0x801a4b000,0x1000,0x801a4a068)
>   5179 postgres RET   getdirentries 0
>   5179 postgres CALL  lseek(0x3,0,SEEK_SET)
>   5179 postgres RET   lseek 0
>   5179 postgres CALL  close(0x3)
>   5179 postgres RET   close 0
>   5179 postgres CALL  open(0x7fffffffe580,O_RDWR|O_CREAT,S_IRUSR|S_IWUSR)
>   5179 postgres NAMI  "pg_notify/0000"
>   5179 postgres RET   open 3
>   5179 postgres CALL  lseek(0x3,0,SEEK_SET)
>   5179 postgres RET   lseek 0
>   5179 postgres CALL  write(0x3,0x8041c1b40,0x2000)
>   5179 postgres GIO   fd 3 wrote 4096 bytes
> ...
>   5179 postgres RET   write 8192/0x2000
>   5179 postgres CALL  close(0x3)
>   5179 postgres RET   close 0
>   5179 postgres CALL  unlink(0x7fffffffbc60)
>   5179 postgres NAMI  "pg_xlog/000000010000000000000001"
>   5179 postgres RET   unlink -1 errno 2 No such file or directory
>   5179 postgres CALL  link(0x7fffffffc130,0x7fffffffbc60)
>   5179 postgres NAMI  "pg_xlog/xlogtemp.5179"
>   5179 postgres NAMI  "pg_xlog/000000010000000000000001"
>   5179 postgres RET   link -1 errno 1 Operation not permitted
>   5179 postgres CALL  unlink(0x7fffffffc130)
>   5179 postgres NAMI  "pg_xlog/xlogtemp.5179"
>   5179 postgres RET   unlink 0
>   5179 postgres CALL  open(0x7fffffffc530,O_RDWR,<unused>0x180)
>   5179 postgres NAMI  "pg_xlog/000000010000000000000001"
>   5179 postgres RET   open -1 errno 2 No such file or directory
>=20
>=20
> > Show the security.bsd sysctl settings, in particular,
> > harlink_check_{u,g}id.ygg# sysctl security.bsd.
>=20
> security.bsd.map_at_zero: 0
> security.bsd.suser_enabled: 1
> security.bsd.unprivileged_proc_debug: 0
> security.bsd.conservative_signals: 1
> security.bsd.see_other_gids: 0
> security.bsd.see_other_uids: 0
> security.bsd.unprivileged_idprio: 0
> security.bsd.unprivileged_read_msgbuf: 0
> security.bsd.hardlink_check_gid: 1
> security.bsd.hardlink_check_uid: 1
> security.bsd.unprivileged_get_quota: 0
> security.bsd.stack_guard_page: 0
>=20
> > Show the ls -la output for the pg_xlog directory.
>=20
> ygg:~> ls -la /zdb/pgsql/data/pg_xlog/
> total 5
> drwx------   3 pgsql  wheel   3 Dec 15 08:39 .
> drwx------  14 pgsql  wheel  18 Dec 15 08:39 ..
> drwx------   2 pgsql  wheel   2 Dec 15 08:39 archive_status

--tuYRN1zEaS85jg/Y
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iQIcBAEBAgAGBQJQzJq8AAoJEJDCuSvBvK1Bv/0P/1WsJbIiT2X2ZAzLoxVW3IDX
9KgB8UJ7hO7o1g+cfjcA2PXBvygc2Mf4/jDQdxlzh5E6W+C89H1ZrFc9bCaehkLV
JDmNjgLN4EB+fLhOn8SkL00ZKSJwTEQvj271I6MwVcB4YAtr5hLrSLzAmDVMndEz
0MrdrC3AOzvJiUkaC7oZQxE8u2JEjCR0NY4V9kdnPJBlsuUYMBbNK4BqJvgKnZ3O
kzgMqr747hAJc6Y6O0HJWIOMfTSoaB+zqjnl5JWtHj+FF+5OptHdnQX2FmyBFjvR
cgcvW1Twsof8ynh+ZUPda+3dIu+0DxLK1KWK/IOGo6hHYzaqA9Nz6WVOaIVZ14Qv
GXfFQ4/hS35+mVHlhT8RUoVsiH/ZSBpgaKT28EnxJ27zdLDuCodJJPG2iktFMe+6
iRQfjxfvoSOUxs9VRXa6BElJr5TGaBGJqb+BA4uduYzLqNmQNlttgLMfUVB6nB5b
ry4s8/yaQVJLimHHdfPl4a/dfIirdPryPcC5DjdkvCe5tRm0rChBpn8psl5HGJ9t
Q4vkmqlcUQY5D4tweJUvnu9xFXvxTFIBu8SyfTsCJ0SeMNxWBCQaomdPm8iTzSXR
iZWBc2C7l3lQ4UC0Qfq2mq7ZwvKZ5G3Dic6DbvYvLVR5FJXcHLWM6xhQjJjqxJcI
bkmf5uEY/P442uziAOXM
=GAOR
-----END PGP SIGNATURE-----

--tuYRN1zEaS85jg/Y--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121215154356.GW71906>