/usr/bin/perl: bad interpreter: Text file busy

chris picture chris · Sep 6, 2009 · Viewed 33k times · Source

This is a new one for me: What does this error indicate?

  /usr/bin/perl: bad interpreter: Text file busy

There were a couple of disk-intensive processes running at the time, but I've never seen that message before—in fact, this is the first time that I can remember getting an error when trying to run a Perl script. After a few seconds of waiting, I was able to run it, and haven't seen the issue since, but it would be nice to have an explanation for this.

Running Ubuntu 9.04, file system is ext3.

Answer

cjm picture cjm · Sep 6, 2009

I'd guess you encountered this issue.

The Linux kernel will generate a bad interpreter: Text file busy error if your Perl script (or any other kind of script) is open for writing when you try to execute it.

You don't say what the disk-intensive processes were doing. Is it possible one of them had the script open for read+write access (even if it wasn't actually writing anything)?