From owner-freebsd-hackers@FreeBSD.ORG Sat Dec 15 15:02:36 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 0A70EDDB for ; Sat, 15 Dec 2012 15:02:36 +0000 (UTC) (envelope-from david.i.noel@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id BBB028FC0C for ; Sat, 15 Dec 2012 15:02:35 +0000 (UTC) Received: by mail-ob0-f182.google.com with SMTP id 16so4371982obc.13 for ; Sat, 15 Dec 2012 07:02:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=ZmM+5ier41EZFHmmiSXjrNTFXMafZPjuxMj5+/zRJ30=; b=ESFkn07hOyVHx6JWOmJ/ue2LuKPzrZBJHOggVM4cd1nS2+ebs8xpfqmFinWjYvY372 FrfyZ1eZC4hzT3VCsgLK+PYBjB9898FW8SucwyU6BND/qcsvFAZOmuv6/GYoOC92i/x4 DsMWd0ZtawVtkVqQzbVa9kCSLsRKcbGtj37zl7tUHTaJ8aEggCqVvkLt0sCPHZJEmpyU 9ToaBYMs8vbxjxEzHKKUoC6wcifEzlpi1+Nh1Z1D+re/otFJNNe+2G3r6RF4nhg/Vkk5 Hf2jU2OayhhYULBTdTpBMI2WqkArNDjC3tSqE+7BxYnQQxiVXLz9wKp4j1Z41j9vhQNT dJlg== MIME-Version: 1.0 Received: by 10.60.32.234 with SMTP id m10mr6639995oei.7.1355583755010; Sat, 15 Dec 2012 07:02:35 -0800 (PST) Received: by 10.76.172.98 with HTTP; Sat, 15 Dec 2012 07:02:34 -0800 (PST) In-Reply-To: <20121215095324.GU71906@kib.kiev.ua> References: <20121215095324.GU71906@kib.kiev.ua> Date: Sat, 15 Dec 2012 09:02:34 -0600 Message-ID: Subject: Re: postgres, initdb, FreeBSD bug? From: David Noel To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: David.I.Noel@gmail.com 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:02:36 -0000 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. Many thanks, -David > Show the ktrace from the same error on UFS. 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 > Show the security.bsd sysctl settings, in particular, > harlink_check_{u,g}id.ygg# sysctl security.bsd. 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 > Show the ls -la output for the pg_xlog directory. 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