From owner-freebsd-hackers@FreeBSD.ORG Sat Dec 15 15:44:06 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1D8F66DC for ; Sat, 15 Dec 2012 15:44:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 67F308FC14 for ; Sat, 15 Dec 2012 15:44:05 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qBFFhuuf063241; Sat, 15 Dec 2012 17:43:56 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.3 kib.kiev.ua qBFFhuuf063241 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qBFFhukM063240; Sat, 15 Dec 2012 17:43:56 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 15 Dec 2012 17:43:56 +0200 From: Konstantin Belousov To: David Noel Subject: Re: postgres, initdb, FreeBSD bug? Message-ID: <20121215154356.GW71906@kib.kiev.ua> References: <20121215095324.GU71906@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tuYRN1zEaS85jg/Y" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 15:44:06 -0000 --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,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--