Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 05 Mar 1995 07:23:16 -0800
From:      David Greenman <davidg@Root.COM>
To:        John Hay <jhay@mikom.csir.co.za>
Cc:        current@FreeBSD.org
Subject:   Re: "Text file busy" with program not running anymore? 
Message-ID:  <199503051523.HAA00249@corbin.Root.COM>
In-Reply-To: Your message of "Sat, 05 Mar 95 11:02:20 %2B0200." <199503050902.LAA18774@dolphin.mikom.csir.co.za> 

next in thread | previous in thread | raw e-mail | index | archive | help
>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.

-DG



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199503051523.HAA00249>