SUBSTANTIAL UPDATE:
Previously, I'd thought this must be due to an issue involving NFS, however, now it has occurred with NO NFS involvement - and on one of the very same files. So... "From the top:"
I have a script undergoing development - I always seem to have some script under development - and leaving an edit session open is just standard practice so it's easy to undo changes and try again. And, unlike the literally thousands of times this has gone on over the last 25 years here, on Fedora of some version or other, last night, for the first time, I began getting:
/bin/bash: bad interpreter: Text file busy
when trying to test the script.
The error clears of its own accord eventually, but the wait can be interminably long! Every once in a while the wait is totally ridiculous! ("Ridiculous" here is measured in many minutes - enough to draw me here!) Note that after some edits, there's no delay at all and it just works, and on other occasions it clears in just a few seconds, and then every once in a while it takes "ridiculous time" to clear. And as I'm constantly testing, this is more than just annoying.
Is there anything I can do to force it to clear? (I'm thinking a command-at-the-ready to fire off, if that's possible.)
I did my research: this is NOT a problem that's already noted here - not that I could find anyway... If someone wants me to cite all the similar but different questions / answers here, I'll do that, but prefer not to.
At first I thought this was likely due to heavy IO on the system (and/or NFS). However, it's not. This has even happened when there's no load to speak of. And, I'm the only one logged in and NOTHING would or could touch this script but me as I'm testing it. Nor could anything be messing with the directory tree or even the disk. The ONLY external influence is a continual stream of spam to the mail server on the box. Otherwise, it's just me.
I've been wondering if this is an indication of a hardware error? The system has ECC memory - it's a genuine server system!
As I've been at this literally for decades and NEVER seen this, one wonders "so, what's new?!
Other than a recent reload of Fedora to 35, nothing much! (The Fedora "upgrade" procedure, which is superior to a reinstallation, failed, so we were forced to reinstall "from scratch.")
When I first posted this question, I thought NFS was involved, and this morning I began the edit on the file server system - the one that hosts (among many other things) NFS - and thus, NFS was removed from consideration when it it happened again. And, as I was this time ready with an lsof command, here's what happened:
bash: /scripts/MyNewScript: /bin/bash: bad interpreter: Text file busy
[root@srvr /scripts]# lsof /scripts/MyNewScript
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
(Shortly after this, the script ran and didn't have a problem.)
...I've never taken the time to learn what fuse and gvfsd are. ... Could that / they be the cause?
This is REALLY perplexing!