portupgrade across NFS
Michael.Collette at TestEquity.com
Wed Jun 7 00:43:37 UTC 2006
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
> 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.
More information about the freebsd-questions