From owner-freebsd-current Sun Mar 5 10:21:31 1995 Return-Path: current-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id KAA17034 for current-outgoing; Sun, 5 Mar 1995 10:21:31 -0800 Received: from ref.tfs.com (ref.tfs.com [140.145.254.251]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id KAA17026 for ; Sun, 5 Mar 1995 10:21:30 -0800 Received: (from phk@localhost) by ref.tfs.com (8.6.8/8.6.6) id KAA18600; Sun, 5 Mar 1995 10:20:57 -0800 From: Poul-Henning Kamp Message-Id: <199503051820.KAA18600@ref.tfs.com> Subject: Re: "Text file busy" with program not running anymore? To: davidg@Root.COM Date: Sun, 5 Mar 1995 10:20:56 -0800 (PST) Cc: jhay@mikom.csir.co.za, current@FreeBSD.org In-Reply-To: <199503051523.HAA00249@corbin.Root.COM> from "David Greenman" at Mar 5, 95 07:23:16 am Content-Type: text Content-Length: 1481 Sender: current-owner@FreeBSD.org Precedence: bulk > >I am running FreeBSD-current with a kernel of this morning, if this is > >relevant. I have compiled a program, copied it with cp to another directory > >and executed it from there. Then I changed the source, compiled it again and > >when I tried to copy it, I got the "cp: /users/jhay/bin/u2d: Text file busy" > >message. But the program is not running anymore. I have waited a few minutes, > >thinking that there is some cache that have to timeout, but it did not help. > > > >Now it isn't the end of the world for me, I can just delete the file before > >I copy the new one or use install. > > > >I would just like to know if this is expected behaviour or not? > > It is expected. Whenever a file is executed, the VTEXT flag is set on the > vnode to indicate that someone is executing it. The flag remains set until > there are no references to it and it is no longer cached. In your case, it > lingered in the cache. It never 'times out' - the cached vnodes are replaced > with other cached vnodes - so it will only get out of the cache if there is > activity on the system to flush it out. > It's conceivable that there could be a count instead of a flag...but this > complicates things quite a bit and I don't see the point in it. Just rm the > file first. Wouldn't the right thing be to flush it if it is opened for write ? -- Poul-Henning Kamp TRW Financial Systems, Inc. I am Pentium Of Borg. Division is Futile. You WILL be approximated.