From owner-freebsd-current@FreeBSD.ORG Tue Oct 5 08:23:03 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5EB3106567A; Tue, 5 Oct 2010 08:23:03 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 581238FC29; Tue, 5 Oct 2010 08:23:03 +0000 (UTC) Received: by iwn34 with SMTP id 34so1262281iwn.13 for ; Tue, 05 Oct 2010 01:23:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=JArzsFFSJ+FuSoOj/DeBVyk0NpKJfyiUzmCHPEDBhXA=; b=UZVaAaz3QmuQ3+WzB0Ls+vUiQRs1opbqWyPVLfgr7hzqdaCwZcVN64LrB1UYujMxGW N8+xi+o/2x5LoN7DwPpvQHd1JNkCYZB9VhGojW9Iz6XALj9ur6tG/+YxkMKlWdskFXLi I5c/EO9YzZdwDPmFE0jo63+pefOovzDVLtw48= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=m6gRg5oyzazzP0hg2kT1XI/xqulA7r7/f1ftGb4IFVlu9nZDihjvx3HrIDqTKZoSbS 6gklePBAZjGDs+O+cu1s4HTWWkQDqH/I8YWCR6jG2ymnXCxhJ862reIM1ZVg9Vxpa7G8 NciIQ2rAWGW0PxacBJUgeX4DhjyqKdWlweaT0= MIME-Version: 1.0 Received: by 10.231.19.197 with SMTP id c5mr11679456ibb.151.1286266982419; Tue, 05 Oct 2010 01:23:02 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.231.184.3 with HTTP; Tue, 5 Oct 2010 01:23:02 -0700 (PDT) In-Reply-To: <20101005153410.598e4484.daichi@ongs.co.jp> References: <20101004123725.65d09b9e.daichi@ongs.co.jp> <20101004144927.36822f07.daichi@ongs.co.jp> <20101005093826.17432b1e.daichi@ongs.co.jp> <20101005153410.598e4484.daichi@ongs.co.jp> Date: Tue, 5 Oct 2010 01:23:02 -0700 X-Google-Sender-Auth: ph4VKMZ6u0Ndth8K4UhH-8EqFxM Message-ID: From: Garrett Cooper To: Daichi GOTO Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-fs@freebsd.org, freebsd-current@freebsd.org Subject: Re: fcntl always fails to delete lock file, and PID is always -6464 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 08:23:03 -0000 2010/10/4 Daichi GOTO : > Thanks nice test tool :) =C2=A0And at last I got it excepting one mystery= ! > > On Mon, 4 Oct 2010 20:17:08 -0700 > Garrett Cooper wrote: >> Following through the same process on FreeBSD... >> >> Window 1: >> $ ls -l /tmp/lockfile >> ls: /tmp/lockfile: No such file or directory >> $ ./test_fcntl >> >> Window 2: >> >> $ ls -l /tmp/lockfile >> -rwsr-x--- =C2=A01 garrcoop =C2=A0wheel =C2=A00 Oct =C2=A04 20:14 /tmp/l= ockfile >> $ ./test_fcntl >> test_fcntl: fcntl: Resource temporarily unavailable > > Just my mystery is as follow: > > Windows 1: > % ./test_fcntl > My pid: 43490 > > Windows 2: > % ls -l /tmp/lockfile > -r-sr-x--- =C2=A01 daichi =C2=A0wheel =C2=A00 10=E6=9C=88 =C2=A05 15:02 /= tmp/lockfile =C2=A0 =C2=A0<--- is it weird, isn't it? > % ./test_fcntl > test_fcntl: open: Permission denied > % > > Oops... What's wrong... /tmp is as follow: > > % mount | grep tmp > /dev/ada0s1f on /tmp (ufs, local, noatime, soft-updates) > % dumpfs /tmp | grep journal > flags =C2=A0 soft-updates+journal > % > > And working scene: > > Windows 2: > % chmod u+w /tmp/lockfile > % ls -l /tmp/lockfile > -rwsr-x--- =C2=A01 daichi =C2=A0wheel =C2=A00 10=E6=9C=88 =C2=A05 15:22 /= tmp/lockfile > % ./test_fcntl > My pid: 43646 > test_fcntl: fcntl[1]: Resource temporarily unavailable > PID=3D43490 has the lock > % What's your umask and what are the permissions on /tmp?