From owner-freebsd-questions@FreeBSD.ORG Wed Jun 7 00:43:36 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C2CF216CF11; Wed, 7 Jun 2006 00:24:45 +0000 (UTC) (envelope-from Michael.Collette@TestEquity.com) Received: from smtp.testequity.com (gateway.testequity.com [205.147.14.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id C7D0D43D46; Wed, 7 Jun 2006 00:24:43 +0000 (GMT) (envelope-from Michael.Collette@TestEquity.com) Received: from smtp.priv.testequity.com (unknown [192.168.3.27]) by smtp.testequity.com (Postfix) with ESMTP id 4AB4C13C446; Tue, 6 Jun 2006 17:24:43 -0700 (PDT) Received: from [192.168.3.172] (mach172.priv.testequity.com [192.168.3.172]) by smtp.priv.testequity.com (Postfix) with ESMTP id 41A0CC74D; Tue, 6 Jun 2006 17:24:43 -0700 (PDT) Message-ID: <44861CCF.5040902@TestEquity.com> Date: Tue, 06 Jun 2006 17:24:47 -0700 From: Michael Collette Organization: TestEquity LLC User-Agent: Thunderbird 1.5.0.2 (X11/20060516) MIME-Version: 1.0 To: Sergey Matveychuk References: <4484C065.5000100@TestEquity.com> <44854681.2030902@FreeBSD.org> <4485CEE9.3070501@TestEquity.com> <4485D4F4.60609@FreeBSD.org> In-Reply-To: <4485D4F4.60609@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: portupgrade across NFS X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jun 2006 00:43:37 -0000 Sergey Matveychuk wrote: > Michael Collette wrote: >> No luck. I was back on 2.0.1 which I upgraded with pkg_delete and >> pkg_add. Still the exact same error with deleting the /var/db/pkg >> directory. > > Let's make it clean. You have /var/db/pkg as nfs mounted? You can't > remove /var/db/pkg/portname directory? Got one bad bit of information from my previous post. The problem DOES exist when just performing a pkg_deinstall. Apparently the one test I based my earlier post on wasn't repeatable. The problem is not with the portupgrade script itself. Dug in quite a bit further with this today. When pkg_deinstall calls to pkg_delete a .nfs file is created which is showing as being actively accessed by the ruby process. This file vanishes once pkg_deinstall quits. Due to that file, even attempting a "rm -rf" on that directory will fail within pkg_deinstall. For testing this out, we added a cheap hack to the portupgrade script immediately after the call to pkg_deinstall that just removes the directory once pkg_deinstall has ended. This works, but has no logic or error checking at this point. The pkg_deinstall script does not report that it didn't complete, so the main portupgrade script just keeps on going as though there were no errors. With that being said, what I believe needs to happen in the short term is to have a check within the portupgrade script where if the pkg_deinstall returns successful and the /var/db/pkg directory still exists, delete it. This would be right around line 1721. Obviously the more correct thing to do here would be to correct pkg_deinstall's behavior. That looks like it may be quite a bit more clever to do, thus my recommendation for fixing portupgrade now, and revisit pkg_deinstall later. I'm just concerned that the real problem may have more to do with the ruby engine and NFS than this script, which may take many months to correct. Later on, -- Michael Collette IT Manager TestEquity LLC