6

Very occasionally I encounter "text file busy" error while using my Linux 4.0.4 computer. I read that when the error happens, kernel is preventing modification to a file that is being "used".

So I make sure a file is open (as listed in lsof) and then make modifications to it, everything is fine and "text file busy" error does not happen.

So how do you trigger the an error?

1 Answer 1

11

"Text file busy" means a process is trying to modify an executable while it's running ("text" is about a .text segment, not a text file). To trigger it:

$ cp /usr/bin/yes .

$ ./yes >/dev/null &
[1] 27417

$ cat /dev/null >yes
-bash: yes: Text file busy

$ kill %1
[1]+  Terminated              ./yes > /dev/null

$ cat /dev/null >yes

$ ls -s yes
0 yes

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.